From: William Speirs Date: Tue, 14 Oct 2014 21:16:50 +0000 (-0400) Subject: Wrapped math in int constructor X-Git-Tag: yosys-0.4~42 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fda52f05f277720e12aadb4716415ec9bff616a5;p=yosys.git Wrapped math in int constructor --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 7e15283c4..70976b68b 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -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);