diff options
-rw-r--r-- | src/lj_snap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 7d7347a1..f3645e87 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -453,6 +453,7 @@ static TRef snap_replay_const(jit_State *J, IRIns *ir) | |||
453 | case IR_KNUM: case IR_KINT64: | 453 | case IR_KNUM: case IR_KINT64: |
454 | return lj_ir_k64(J, (IROp)ir->o, ir_k64(ir)->u64); | 454 | return lj_ir_k64(J, (IROp)ir->o, ir_k64(ir)->u64); |
455 | case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir)); /* Continuation. */ | 455 | case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir)); /* Continuation. */ |
456 | case IR_KNULL: return lj_ir_knull(J, irt_type(ir->t)); | ||
456 | default: lj_assertJ(0, "bad IR constant op %d", ir->o); return TREF_NIL; | 457 | default: lj_assertJ(0, "bad IR constant op %d", ir->o); return TREF_NIL; |
457 | } | 458 | } |
458 | } | 459 | } |
@@ -902,9 +903,13 @@ static void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex, | |||
902 | if (irk->o == IR_FREF) { | 903 | if (irk->o == IR_FREF) { |
903 | switch (irk->op2) { | 904 | switch (irk->op2) { |
904 | case IRFL_TAB_META: | 905 | case IRFL_TAB_META: |
905 | snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp); | 906 | if (T->ir[irs->op2].o == IR_KNULL) { |
906 | /* NOBARRIER: The table is new (marked white). */ | 907 | setgcrefnull(t->metatable); |
907 | setgcref(t->metatable, obj2gco(tabV(&tmp))); | 908 | } else { |
909 | snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp); | ||
910 | /* NOBARRIER: The table is new (marked white). */ | ||
911 | setgcref(t->metatable, obj2gco(tabV(&tmp))); | ||
912 | } | ||
908 | break; | 913 | break; |
909 | case IRFL_TAB_NOMM: | 914 | case IRFL_TAB_NOMM: |
910 | /* Negative metamethod cache invalidated by lj_tab_set() below. */ | 915 | /* Negative metamethod cache invalidated by lj_tab_set() below. */ |