]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fill gaps in frames (caused by metamethod calls) with nil.
authorMike Pall <mike>
Mon, 25 Jan 2010 23:45:30 +0000 (00:45 +0100)
committerMike Pall <mike>
Mon, 25 Jan 2010 23:45:30 +0000 (00:45 +0100)
Simplifies storing snapshots to stack.

src/lj_asm.c
src/lj_record.c
src/lj_snap.c

index a8cb3dd004d84c05de37a2d897bf40a8eefdfd91..bff6c9bcef80f34a82566b8051ec483c23d3af0b 100644 (file)
@@ -3045,8 +3045,8 @@ static void asm_tail_sync(ASMState *as)
        }
        emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t));
       }
-    } else if (s > secondbase) {
-      emit_movmroi(as, RID_BASE, ofs+4, LJ_TNIL);
+    } else {
+      lua_assert(!(s > secondbase));
     }
     checkmclim(as);
   }
index 329cbdc54c49035fdcbc6f27623a449af498761f..6af25ccba601313cd231f69075114ca209395888 100644 (file)
@@ -426,7 +426,7 @@ static BCReg rec_mm_prep(jit_State *J, ASMFunction cont)
 #endif
   J->base[top] = emitir(IRTG(IR_FRAME, IRT_PTR), trcont, trcont);
   for (s = J->maxslot; s < top; s++)
-    J->base[s] = 0;
+    J->base[s] = TREF_NIL;
   return top+1;
 }
 
index c2aff3dba47aa06f5012a96ad49019b33c862791..f262e1c96fe29c40854f3cfc47c931a61ab896a9 100644 (file)
@@ -259,8 +259,8 @@ void lj_snap_restore(jit_State *J, void *exptr)
          }
        }
       }
-    } else if (newbase) {
-      setnilV(o);  /* Clear unreferenced slots of newly added frames. */
+    } else {
+      lua_assert(!newbase);
     }
   }
   if (newbase) L->base = newbase;