From cff3d762dc57a3a91e1dfaeccb9fbee5457b6e40 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Mon, 6 May 1996 16:39:46 -0700 Subject: [PATCH] (gen_shifty_op): Truncate VALUE to avoid out of bounds array access. From-SVN: r11947 --- gcc/config/sh/sh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 764bf31d5e8..1f3e43c39c4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -901,6 +901,9 @@ gen_shifty_op (code, operands) int value = INTVAL (operands[2]); int max, i; + /* Truncate the shift count in case it is out of bounds. */ + value = value & 0x1f; + if (value == 31) { if (code == LSHIFTRT)