From fed6d4782a3939d0b260402e2df5706ca036a290 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 9 Jul 2026 10:24:06 +0200 Subject: Don't use destroyed lock when profiler has been stopped. Reported by Miku AuahDark. #1482 #1460 --- src/lj_profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lj_profile.c b/src/lj_profile.c index 5b2a2b6c7..ea65fcb8f 100644 --- a/src/lj_profile.c +++ b/src/lj_profile.c @@ -359,6 +359,7 @@ LUA_API void luaJIT_profile_stop(lua_State *L) ProfileState *ps = &profile_state; global_State *g = ps->g; if (G(L) == g) { /* Only stop profiler if started by this VM. */ + ps->g = NULL; profile_timer_stop(ps); g->hookmask &= ~HOOK_PROFILE; lj_dispatch_update(g, 0); @@ -368,7 +369,6 @@ LUA_API void luaJIT_profile_stop(lua_State *L) #endif lj_buf_free(g, &ps->sb); ps->sb.w = ps->sb.e = NULL; - ps->g = NULL; } } -- cgit v1.2.3-55-g6feb