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

@@ -638,7 +638,8 @@ typedef struct global_State {
#define HOOK_PROFILE 0x80
#define hook_active(g) ((g)->hookmask & HOOK_ACTIVE)
#define hook_enter(g) ((g)->hookmask |= HOOK_ACTIVE)
#define hook_entergc(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_GC))
#define hook_entergc(g) \
((g)->hookmask = ((g)->hookmask | (HOOK_ACTIVE|HOOK_GC)) & ~HOOK_PROFILE)
#define hook_vmevent(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_VMEVENT))
#define hook_leave(g) ((g)->hookmask &= ~HOOK_ACTIVE)
#define hook_save(g) ((g)->hookmask & ~HOOK_EVENTMASK)