From 12d5aa08e2eef97e4c50d240a0d6c01b3e246ee2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 26 Nov 2008 16:40:33 -0800 Subject: [PATCH] V0.8: A $signed can make a concat signed. This patch mirrors what was done in development to fix the signed concat problem. --- eval_tree.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eval_tree.cc b/eval_tree.cc index 2e39792dc..b213e59e3 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -1075,6 +1075,12 @@ NetEConst* NetEConcat::eval_tree() val = verinum(val.as_string()); } + // Normally, concatenations are unsigned. However, the + // $signed() function works by marking the expression as + // signed, so we really have to check. + val.has_sign( this->has_sign() ); + + NetEConst*res = new NetEConst(val); res->set_width(val.len()); return res;