Fix lval extension for compressed assignment in constant function.

The type of extension (zero/sign) is determined by the expression
type, not the operand type, so we need to cast to the expression
type before extending the value.
This commit is contained in:
Martin Whitaker 2016-02-23 16:46:26 +00:00
parent b77d758f19
commit 241b6723e5
1 changed files with 1 additions and 1 deletions

View File

@ -252,8 +252,8 @@ void NetAssign::eval_func_lval_op_(const LineInfo&loc,
break;
default:
// The left operand must be cast to the expression type/size
lv = cast_to_width(lv, rv.len());
lv.has_sign(rv.has_sign());
lv = cast_to_width(lv, rv.len());
}
switch (op_) {
case '+':