diff mbox

Patch committed: Fix -fsplit-stack with very large parameters

Message ID mcrvcs0bekn.fsf@coign.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 7, 2011, 10:51 p.m. UTC
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.
diff mbox

Patch

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;