diff --git a/eval_tree.cc b/eval_tree.cc index 0a0dec69c..be195159f 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -1200,6 +1200,11 @@ NetEConst* NetEConcat::eval_tree(int prune_to_width) 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;