Fix interaction between profiler hooks and finalizers.

Thanks to Julien Desgats.
This commit is contained in:
Mike Pall
2019-12-08 19:56:56 +01:00
parent 9600e4318e
commit 92fa45f9eb
3 changed files with 5 additions and 2 deletions

View File

@@ -153,7 +153,7 @@ static void profile_trigger(ProfileState *ps)
profile_lock(ps);
ps->samples++; /* Always increment number of samples. */
mask = g->hookmask;
if (!(mask & (HOOK_PROFILE|HOOK_VMEVENT))) { /* Set profile hook. */
if (!(mask & (HOOK_PROFILE|HOOK_VMEVENT|HOOK_GC))) { /* Set profile hook. */
int st = g->vmstate;
ps->vmstate = st >= 0 ? 'N' :
st == ~LJ_VMST_INTERP ? 'I' :