]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM: Fix excess stack growth in interpreter.
authorMike Pall <mike>
Sat, 27 Dec 2014 04:59:16 +0000 (05:59 +0100)
committerMike Pall <mike>
Sat, 27 Dec 2014 04:59:16 +0000 (05:59 +0100)
src/vm_arm.dasc

index 82cba909cf3e97594355c9b9d6ccfe837a05055f..0865d01659b4d88944cd8dabcd2d94824526865b 100644 (file)
@@ -335,7 +335,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  // - The GC shrinks the stack in between.
   |  // - A return back from a lua_call() with (high) nresults adjustment.
   |  str BASE, L->top                  // Save current top held in BASE (yes).
-  |  mov CARG2, KBASE
+  |  lsr CARG2, KBASE, #3
   |  mov CARG1, L
   |  bl extern lj_state_growstack      // (lua_State *L, int n)
   |  ldr BASE, L->top                  // Need the (realloced) L->top in BASE.
@@ -389,7 +389,7 @@ static void build_subroutines(BuildCtx *ctx)
   |  str BASE, L->base
   |   add PC, PC, #4                   // Must point after first instruction.
   |  str RC, L->top
-  |   lsr CARG3, RA, #3
+  |   lsr CARG2, RA, #3
   |2:
   |  // L->base = new base, L->top = top
   |  str PC, SAVE_PC