Wrapped math in int constructor

This commit is contained in:
William Speirs 2014-10-14 17:16:50 -04:00 committed by Clifford Wolf
parent 34caeeb4f3
commit fda52f05f2
1 changed files with 1 additions and 1 deletions

View File

@ -1123,7 +1123,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
log_error("Unsupported expression on dynamic range select on signal `%s' at %s:%d!\n",
str.c_str(), filename.c_str(), linenum);
result_width = abs(left_at_zero_ast->integer - right_at_zero_ast->integer) + 1;
result_width = abs(int(left_at_zero_ast->integer - right_at_zero_ast->integer)) + 1;
}
did_something = true;
newNode = new AstNode(AST_CASE, shift_expr);