diff options
author | Jim Wilson <wilson@cygnus.com> | 1999-09-10 20:28:12 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1999-09-10 13:28:12 -0700 |
commit | 007598f98beabc445971351a4d6c60054f089491 (patch) | |
tree | f1a1c63dd54a53c776548d53d77f15f05f6926ee /gcc/except.c | |
parent | ffb9f2f152d6ba3dc88802669466fd87744c12f4 (diff) | |
download | gcc-007598f98beabc445971351a4d6c60054f089491.tar.gz |
Fix too small buffer problem found by ia64 port.
* except.c (start_dynamic_handler): Compute size using
STACK_SAVEAREA_MODE.
From-SVN: r29275
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/except.c b/gcc/except.c index f74d8fbf09f..d36fec673e7 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -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; |