]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Don't copy SNAP_NORESTORE mark into loops and suppress restore in exit.
authorMike Pall <mike>
Wed, 7 Apr 2010 23:28:51 +0000 (01:28 +0200)
committerMike Pall <mike>
Wed, 7 Apr 2010 23:32:26 +0000 (01:32 +0200)
src/lj_jit.h
src/lj_snap.c

index 7850878dd6937fafb33ef059651846d44596341c..adb6f2d5036ef38630ed3157a17056e95df3952c 100644 (file)
@@ -140,7 +140,7 @@ LJ_STATIC_ASSERT(SNAP_CONT == TREF_CONT);
 #define snap_slot(sn)          ((BCReg)((sn) >> 24))
 #define snap_isframe(sn)       ((sn) & SNAP_FRAME)
 #define snap_pc(sn)            ((const BCIns *)(uintptr_t)(sn))
-#define snap_setref(sn, ref)   (((sn) & 0xffff0000) | (ref))
+#define snap_setref(sn, ref)   (((sn) & (0xffff0000&~SNAP_NORESTORE)) | (ref))
 
 /* Snapshot and exit numbers. */
 typedef uint32_t SnapNo;
index fe0389fe31a4d9f45af0fb98f591e467d08c05ed..743f05cf44be2a760ae26204845bcfc8895a1ba0 100644 (file)
@@ -267,7 +267,7 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
          }
        }
       }
-    } else {
+    } else if (!(sn & SNAP_NORESTORE)) {
       IRType1 t = ir->t;
       RegSP rs = ir->prev;
       lua_assert(!(sn & (SNAP_CONT|SNAP_FRAME)));