From 236f56949fffd5e4a0eca090aef739f2a6297925 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 24 Jun 2009 10:07:12 -0700 Subject: [PATCH] Use correct sign for signal and constant addition. This was incorrectly using the expression sign not checking if the two sub-expressions are both signed. This likely used to work, but in the context of $signed which sets the expression to signed so we can have a signed expression without both sub-expressions being signed. --- tgt-vvp/eval_expr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index f9c72b1ef..cd8bb004a 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -1396,9 +1396,9 @@ static struct vector_info draw_binary_expr_arith(ivl_expr_t exp, unsigned wid) struct vector_info lv; struct vector_info rv; - const char*sign_string = ivl_expr_signed(le) && ivl_expr_signed(re)? "/s" : ""; + int signed_flag = ivl_expr_signed(le) && ivl_expr_signed(re) ? 1 : 0; + const char*sign_string = signed_flag ? "/s" : ""; - int signed_flag = ivl_expr_signed(exp)? 1 : 0; if ((ivl_expr_opcode(exp) == '+') && (ivl_expr_type(le) == IVL_EX_SIGNAL)