Fix for pr2146824.
Currently, a bitwise boolean operator will cause the expression width to be reduced to the size of the result. This can give rise to incorrect results. This patch changes the behaviour to take into account the required precision for calculating the two operands.
This commit is contained in:
parent
082e06edb0
commit
610dedc2b8
|
|
@ -122,7 +122,10 @@ bool NetEBBits::set_width(unsigned w, bool)
|
|||
/* */
|
||||
|
||||
unsigned use_width = w;
|
||||
|
||||
if (left_->expr_width() > use_width)
|
||||
use_width = left_->expr_width();
|
||||
if (right_->expr_width() > use_width)
|
||||
use_width = right_->expr_width();
|
||||
|
||||
/* If the operands end up too small, then pad them to suit. */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue