aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2010-01-26 00:45:30 +0100
committerMike Pall <mike>2010-01-26 00:45:30 +0100
commit34d84f88368953ac0bf1e535b792ab2dd144bc60 (patch)
tree190d9da9908f551b5861a3e6ea6c43b028ae308d
parent47f1bc80d829e472f898609e2c44022f838a3eb3 (diff)
downloadluajit-34d84f88368953ac0bf1e535b792ab2dd144bc60.tar.gz
luajit-34d84f88368953ac0bf1e535b792ab2dd144bc60.tar.bz2
luajit-34d84f88368953ac0bf1e535b792ab2dd144bc60.zip
Fill gaps in frames (caused by metamethod calls) with nil.
Simplifies storing snapshots to stack.
-rw-r--r--src/lj_asm.c4
-rw-r--r--src/lj_record.c2
-rw-r--r--src/lj_snap.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index a8cb3dd0..bff6c9bc 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -3045,8 +3045,8 @@ static void asm_tail_sync(ASMState *as)
3045 } 3045 }
3046 emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t)); 3046 emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t));
3047 } 3047 }
3048 } else if (s > secondbase) { 3048 } else {
3049 emit_movmroi(as, RID_BASE, ofs+4, LJ_TNIL); 3049 lua_assert(!(s > secondbase));
3050 } 3050 }
3051 checkmclim(as); 3051 checkmclim(as);
3052 } 3052 }
diff --git a/src/lj_record.c b/src/lj_record.c
index 329cbdc5..6af25ccb 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -426,7 +426,7 @@ static BCReg rec_mm_prep(jit_State *J, ASMFunction cont)
426#endif 426#endif
427 J->base[top] = emitir(IRTG(IR_FRAME, IRT_PTR), trcont, trcont); 427 J->base[top] = emitir(IRTG(IR_FRAME, IRT_PTR), trcont, trcont);
428 for (s = J->maxslot; s < top; s++) 428 for (s = J->maxslot; s < top; s++)
429 J->base[s] = 0; 429 J->base[s] = TREF_NIL;
430 return top+1; 430 return top+1;
431} 431}
432 432
diff --git a/src/lj_snap.c b/src/lj_snap.c
index c2aff3db..f262e1c9 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -259,8 +259,8 @@ void lj_snap_restore(jit_State *J, void *exptr)
259 } 259 }
260 } 260 }
261 } 261 }
262 } else if (newbase) { 262 } else {
263 setnilV(o); /* Clear unreferenced slots of newly added frames. */ 263 lua_assert(!newbase);
264 } 264 }
265 } 265 }
266 if (newbase) L->base = newbase; 266 if (newbase) L->base = newbase;