Test the width of expression for shift amounts.

The right-operand of shift expressions is self-determined, but we still
need to run a test_width to get the PExpr decorated with types and
expression widths.
This commit is contained in:
Stephen Williams 2008-10-14 19:36:48 -07:00
parent fff5e494ed
commit 5fdd9d8339
1 changed files with 12 additions and 0 deletions

View File

@ -816,6 +816,18 @@ unsigned PEBShift::test_width(Design*des, NetScope*scope,
<< endl;
}
// Run a test-width on the shift amount so that its types are
// worked out for elaboration later on. We don't need the
// value now.
ivl_variable_type_t rtype = IVL_VT_NO_TYPE;
bool rflag = false;
unsigned wid_right = right_->test_width(des, scope, 0, 0, rtype, rflag);
if (debug_elaborate)
cerr << get_fileline() << ": debug: "
<< "Test width of shift amount of shift expression "
<< "returns wid=" << wid_right << ", type=" << rtype
<< ", flag=" << rflag << endl;
return wid_left;
}