This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch committed: Fix -fsplit-stack with very large parameters
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 Oct 2011 15:51:36 -0700
- Subject: Patch committed: Fix -fsplit-stack with very large parameters
The -fsplit-stack runtime support code has a bug reported in PR 46093:
if the size of the stack parameters is exceptionally large, the
parameters can overrun the entire newly allocated stack segment. This
patch fixes the problem. Bootstrapped and tested on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
2011-10-07 Ian Lance Taylor <iant@google.com>
PR target/46093
* generic-morestack.c (__generic_morestack): Make sure the segment
is large enough for both the stack frame and the copied
parameters.
Index: generic-morestack.c
===================================================================
--- generic-morestack.c (revision 179665)
+++ generic-morestack.c (working copy)
@@ -512,7 +512,7 @@ __generic_morestack (size_t *pframe_size
current = *pp;
if (current == NULL)
- current = allocate_segment (frame_size);
+ current = allocate_segment (frame_size + param_size);
current->old_stack = old_stack;