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.

(cherry picked from commit 241b6723e5)
This commit is contained in:
Martin Whitaker 2016-02-23 16:46:26 +00:00
parent 2771abf86a
commit ec9897af5a
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 '+':