concatentations that reduce to constants need proper signed-ness
It is possible, via the use of the $signed() function, for concatenation expressions to be signed. Make sure the evaluated constant had the proper sign by checking explicitly.
This commit is contained in:
parent
1a3e655285
commit
1c90997499
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue