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;