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:
Martin Whitaker 2008-10-04 21:19:27 +01:00 committed by Stephen Williams
parent 082e06edb0
commit 610dedc2b8
1 changed files with 4 additions and 1 deletions

View File

@ -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. */