]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgexpand.c (expand_stack_vars): Add checking to make sure that the offset of a varia...
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Wed, 17 Oct 2007 21:12:50 +0000 (21:12 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Wed, 17 Oct 2007 21:12:50 +0000 (14:12 -0700)
2007-10-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * cfgexpand.c (expand_stack_vars): Add checking to make sure
        that the offset of a variable is not greater than the size
        of the paritition.

From-SVN: r129420

gcc/ChangeLog
gcc/cfgexpand.c

index 9973adbd0588c9d15cee162a431a1072c9bdc27d..d0114fd04bc6608b9add990f2d1abe37d1a7952f 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       * cfgexpand.c (expand_stack_vars): Add checking to make sure
+       that the offset of a variable is not greater than the size
+       of the paritition.
+
 2007-10-17  Anatoly Sokolov <aesok@post.ru>
 
        * config/avr/avr.c (avr_mcu_types): Add support for atmega48p, 
index 769483b8b23d318ebc9f9eae6f3acbb9c651b74d..0a4e2ca91e68507dbfd7c4284d6b8f40980ac88f 100644 (file)
@@ -579,8 +579,11 @@ expand_stack_vars (bool (*pred) (tree))
       /* Create rtl for each variable based on their location within the
         partition.  */
       for (j = i; j != EOC; j = stack_vars[j].next)
-       expand_one_stack_var_at (stack_vars[j].decl,
-                                stack_vars[j].offset + offset);
+       {
+         gcc_assert (stack_vars[j].offset <= stack_vars[i].size);
+         expand_one_stack_var_at (stack_vars[j].decl,
+                                  stack_vars[j].offset + offset);
+       }
     }
 }