aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-02-22 02:34:18 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-02-22 02:34:18 +0000
commit872cbb32e06acfc58d3ae000923272056994a699 (patch)
tree01ce8ed56610aef23bd44a6e2e838a87746b428f /gcc
parent7de97f9e1a0c1252ffc640f91061015cea939f32 (diff)
downloadgcc-872cbb32e06acfc58d3ae000923272056994a699.zip
gcc-872cbb32e06acfc58d3ae000923272056994a699.tar.gz
gcc-872cbb32e06acfc58d3ae000923272056994a699.tar.bz2
Test shift count for overflow.
From-SVN: r170384
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/expressions.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index a073f9d..3d687a6 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -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);