diff options
-rw-r--r-- | src/buildvm_ppc.dasc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index 7e8178cd..d016ec47 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
@@ -329,7 +329,20 @@ static void build_subroutines(BuildCtx *ctx) | |||
329 | | b <3 | 329 | | b <3 |
330 | | | 330 | | |
331 | |8: // Corner case: need to grow stack for filling up results. | 331 | |8: // Corner case: need to grow stack for filling up results. |
332 | | NYI | 332 | | // This can happen if: |
333 | | // - A C function grows the stack (a lot). | ||
334 | | // - The GC shrinks the stack in between. | ||
335 | | // - A return back from a lua_call() with (high) nresults adjustment. | ||
336 | | stw BASE, L->top // Save current top held in BASE (yes). | ||
337 | | mr SAVE0, RD | ||
338 | | mr CARG2, TMP2 | ||
339 | | mr CARG1, L | ||
340 | | bl extern lj_state_growstack // (lua_State *L, int n) | ||
341 | | lwz TMP2, SAVE_NRES | ||
342 | | mr RD, SAVE0 | ||
343 | | slwi TMP2, TMP2, 3 | ||
344 | | lwz BASE, L->top // Need the (realloced) L->top in BASE. | ||
345 | | b <2 | ||
333 | | | 346 | | |
334 | |->vm_unwind_c: // Unwind C stack, return from vm_pcall. | 347 | |->vm_unwind_c: // Unwind C stack, return from vm_pcall. |
335 | | NYI | 348 | | NYI |