From ec9897af5aa94d67c01ebac061357cdf65d1f304 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 23 Feb 2016 16:46:26 +0000 Subject: [PATCH] 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 241b6723e530d204619b0b73f78a4038af3667f3) --- net_func_eval.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_func_eval.cc b/net_func_eval.cc index d53471f3b..9e045c63c 100644 --- a/net_func_eval.cc +++ b/net_func_eval.cc @@ -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 '+':