From: wolfgang Date: Sun, 11 Sep 2005 23:56:24 +0000 (+0000) Subject: [project @ 2005-09-11 23:56:24 by wolfgang] X-Git-Tag: Initial_conversion_from_CVS_complete~228 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a8cca7814a54726a640d2e203133ae27cd070b79;p=ghc-hetmet.git [project @ 2005-09-11 23:56:24 by wolfgang] Darwin/x86: Align the stack correctly when entering Haskell code. --- diff --git a/ghc/rts/StgCRun.c b/ghc/rts/StgCRun.c index 46e573c..c24620a 100644 --- a/ghc/rts/StgCRun.c +++ b/ghc/rts/StgCRun.c @@ -141,14 +141,32 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { */ "movl %3,%%ebx\n\t" /* - * grab the function argument from the stack, and jump to it. + * grab the function argument from the stack */ "movl %2,%%eax\n\t" + +#if darwin_TARGET_OS + /* + * Darwin: keep the stack aligned + */ + "subl $12,%%esp\n\t" +#endif + + /* + * jump to it + */ "jmp *%%eax\n\t" STG_GLOBAL STG_RETURN "\n" STG_RETURN ":\n\t" +#if darwin_TARGET_OS + /* + * Darwin: keep the stack aligned + */ + "addl $12,%%esp\n\t" +#endif + "movl %%esi, %%eax\n\t" /* Return value in R1 */ /*