[Mplayer-cvslog] CVS: main/loader pe_image.c,1.7,1.8

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sat Sep 18 11:10:50 CEST 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/loader
In directory mail:/var2/tmp/cvs-serv26397/loader

Modified Files:
	pe_image.c 
Log Message:
force compilers not to optimize/inline extend_stack_for_dll_alloca


Index: pe_image.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/pe_image.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pe_image.c	13 Sep 2002 19:43:13 -0000	1.7
+++ pe_image.c	18 Sep 2004 09:10:47 -0000	1.8
@@ -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
 }
 




More information about the MPlayer-cvslog mailing list