X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-assem.S;h=32ec9123af3bd5c5db5bfe1726dfe418b0199c27;hb=0285aa5ff8416027932daa001b84429be2ca559b;hp=3f0dd991c0d39c81d91a4887dbf1362ef15084b9;hpb=cdd026dddac3eaddbaa0221503e49e2673d54545;p=sbcl.git diff --git a/src/runtime/ppc-assem.S b/src/runtime/ppc-assem.S index 3f0dd99..32ec912 100644 --- a/src/runtime/ppc-assem.S +++ b/src/runtime/ppc-assem.S @@ -605,10 +605,23 @@ CSYMBOL(undefined_tramp): /* Point reg_CODE to the header and tag it as function, since the debugger regards a function pointer in reg_CODE which doesn't point to a code object as undefined function. */ - bcl 20,31,.+4 /* get address of the next instruction */ - mflr reg_CODE /* header 1 extra word back from here */ - addi reg_CODE,reg_CODE,-(SIMPLE_FUN_CODE_OFFSET+4) - + /* We are given that reg_LIP points to undefined_tramp by + virtue of the calling convention. */ + addi reg_CODE,reg_LIP,-SIMPLE_FUN_CODE_OFFSET + + /* If we are called with stack arguments (or in a tail-call + scenario), we end up with an allocated stack frame, but the + frame link information is uninitialized. Fix things by + allocating and initializing our stack frame "properly". */ + cmpwi cr0,reg_NARGS,16 + bt gt,1f + addi reg_CSP,reg_CFP,16 + b 2f +1: add reg_CSP,reg_CFP,reg_NARGS +2: stw reg_OCFP,0(reg_CFP) + stw reg_LRA,4(reg_CFP) + + /* Now that the preliminaries are dealt with, actually trap. */ twllei reg_ZERO,trap_Cerror .byte 4 .byte UNDEFINED_FUN_ERROR