Check expression width for sanity
Assertion to check for insane expression widths that are likely caused by compiler bugs.
This commit is contained in:
parent
0bb1f9740b
commit
729771e562
|
|
@ -1992,6 +1992,13 @@ void NetExpr::cast_signed(bool flag)
|
|||
signed_flag_ = flag;
|
||||
}
|
||||
|
||||
void NetExpr::expr_width(unsigned w)
|
||||
{
|
||||
// Catch underflow wrap errors.
|
||||
ivl_assert(*this, w < (UINT_MAX - 256));
|
||||
width_ = w;
|
||||
}
|
||||
|
||||
bool NetExpr::has_width() const
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue