projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7de97f9
)
Test shift count for overflow.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 22 Feb 2011 02:34:18 +0000
(
02:34
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 22 Feb 2011 02:34:18 +0000
(
02:34
+0000)
From-SVN: r170384
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index a073f9dfae9c9d8852e5e6dcf39cda7da57e8e43..3d687a613d472b9f46be4571a3e8aa51651e9bc4 100644
(file)
--- 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);