Test shift count for overflow.
From-SVN: r170384
This commit is contained in:
parent
7de97f9e1a
commit
872cbb32e0
1 changed files with 1 additions and 1 deletions
|
@ -4434,7 +4434,7 @@ Binary_expression::eval_integer(Operator op, Type* left_type, mpz_t left_val,
|
|||
case OPERATOR_LSHIFT:
|
||||
{
|
||||
unsigned long shift = mpz_get_ui(right_val);
|
||||
if (mpz_cmp_ui(right_val, shift) != 0)
|
||||
if (mpz_cmp_ui(right_val, shift) != 0 || shift > 0x100000)
|
||||
{
|
||||
error_at(location, "shift count overflow");
|
||||
mpz_set_ui(val, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue