# HG changeset patch # User reimar # Date 1095498647 0 # Node ID 460281609f28120b611233642da1d7175683fe39 # Parent e9403636401179833fe01a3c5eef45992a800ad8 force compilers not to optimize/inline extend_stack_for_dll_alloca diff -r e94036364011 -r 460281609f28 loader/pe_image.c --- a/loader/pe_image.c Sat Sep 18 04:20:13 2004 +0000 +++ b/loader/pe_image.c Sat Sep 18 09:10:47 2004 +0000 @@ -895,12 +895,14 @@ * memory below %esp; it segfaults. * The extend_stack_for_dll_alloca() routine just preallocates a big chunk * of memory on the stack, for use by the DLLs alloca routine. + * Added the noinline attribute as e.g. gcc 3.2.2 inlines this function + * in a way that breaks it. */ -static void extend_stack_for_dll_alloca(void) +static void __attribute__((noinline)) extend_stack_for_dll_alloca(void) { #ifndef __FreeBSD__ - void* mem=alloca(0x20000); - *(int*)mem=0x1234; + volatile int* mem=alloca(0x20000); + *mem=0x1234; #endif }