Commit cff3d762 by Jim Wilson

(gen_shifty_op): Truncate VALUE to avoid out of bounds array access.

From-SVN: r11947
parent d2cba896
...@@ -901,6 +901,9 @@ gen_shifty_op (code, operands) ...@@ -901,6 +901,9 @@ gen_shifty_op (code, operands)
int value = INTVAL (operands[2]); int value = INTVAL (operands[2]);
int max, i; int max, i;
/* Truncate the shift count in case it is out of bounds. */
value = value & 0x1f;
if (value == 31) if (value == 31)
{ {
if (code == LSHIFTRT) if (code == LSHIFTRT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment