diff --git a/src/lj_gc.c b/src/lj_gc.c index 572e4710..ddbaa645 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c @@ -684,12 +684,14 @@ int LJ_FASTCALL lj_gc_step(lua_State *L) } while ((int32_t)lim > 0); if (g->gc.debt < GCSTEPSIZE) { g->gc.threshold = g->gc.total + GCSTEPSIZE; + g->vmstate = ostate; + return 1; } else { g->gc.debt -= GCSTEPSIZE; g->gc.threshold = g->gc.total; + g->vmstate = ostate; + return 0; } - g->vmstate = ostate; - return 0; } /* Ditto, but fix the stack top first. */ diff --git a/src/lj_trace.c b/src/lj_trace.c index 2b8d931f..466d9cd2 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c @@ -781,7 +781,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr) /* Just exit to interpreter. */ } else if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { if (!(G(L)->hookmask & HOOK_GC)) - lj_gc_step(L); /* Exited because of GC: drive GC forward. */ + lj_gc_check(L); /* Exited because of GC: drive GC forward. */ } else { trace_hotside(J, pc); }