]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix too small buffer problem found by ia64 port.
authorJim Wilson <wilson@cygnus.com>
Fri, 10 Sep 1999 20:28:12 +0000 (20:28 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 10 Sep 1999 20:28:12 +0000 (13:28 -0700)
* except.c (start_dynamic_handler): Compute size using
STACK_SAVEAREA_MODE.

From-SVN: r29275

gcc/ChangeLog
gcc/except.c

index 0e52036b0b46364d2844081ad15ebcd8910c9ccb..f174de13e198545bd385cd85d63009b15f90aac7 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 10 13:21:21 1999  Jim Wilson  <wilson@cygnus.com>
+
+       * except.c (start_dynamic_handler): Compute size using
+       STACK_SAVEAREA_MODE.
+
 Fri Sep 10 16:01:23 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * protoize.c: Remove various __STDC__ and POSIX hacks.  Don't
index f74d8fbf09f6ffc8f2ecff0648a2729eb46dc721..d36fec673e704fe4f71cdbe8428c054cbeefc06c 100644 (file)
@@ -1273,9 +1273,14 @@ start_dynamic_handler ()
 
 #ifndef DONT_USE_BUILTIN_SETJMP
   /* The number of Pmode words for the setjmp buffer, when using the
-     builtin setjmp/longjmp, see expand_builtin, case
-     BUILT_IN_LONGJMP.  */
-  size = 5;
+     builtin setjmp/longjmp, see expand_builtin, case BUILT_IN_LONGJMP.  */
+  /* We use 2 words here before calling expand_builtin_setjmp.
+     expand_builtin_setjmp uses 2 words, and then calls emit_stack_save.
+     emit_stack_save needs space of size STACK_SAVEAREA_MODE (SAVE_NONLOCAL).
+     Subtract one, because the assign_stack_local call below adds 1.  */
+  size = (2 + 2 + (GET_MODE_SIZE (STACK_SAVEAREA_MODE (SAVE_NONLOCAL))
+                  / GET_MODE_SIZE (Pmode))
+         - 1);
 #else
 #ifdef JMP_BUF_SIZE
   size = JMP_BUF_SIZE;