Fixed width detection for replicate operator

This commit is contained in:
Clifford Wolf 2013-11-07 12:43:04 +01:00
parent db42a8f89b
commit b52bf379b9
1 changed files with 1 additions and 0 deletions

View File

@ -655,6 +655,7 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint)
break; break;
case AST_REPLICATE: case AST_REPLICATE:
while (children[0]->simplify(true, false, false, 1, -1, false) == true) { }
if (children[0]->type != AST_CONSTANT) if (children[0]->type != AST_CONSTANT)
log_error("Left operand of replicate expression is not constant at %s:%d!\n", filename.c_str(), linenum); log_error("Left operand of replicate expression is not constant at %s:%d!\n", filename.c_str(), linenum);
children[1]->detectSignWidthWorker(sub_width_hint, sub_sign_hint); children[1]->detectSignWidthWorker(sub_width_hint, sub_sign_hint);