aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2026-07-09 10:24:06 +0200
committerMike Pall <mike>2026-07-09 10:24:06 +0200
commitfed6d4782a3939d0b260402e2df5706ca036a290 (patch)
tree6e9b726121ebac3116b2e5913565bd557ebe290a
parentacb223497d84c65139a7eaaac395b42f112249ac (diff)
downloadluajit-fed6d4782a3939d0b260402e2df5706ca036a290.tar.gz
luajit-fed6d4782a3939d0b260402e2df5706ca036a290.tar.bz2
luajit-fed6d4782a3939d0b260402e2df5706ca036a290.zip
Don't use destroyed lock when profiler has been stopped.
Reported by Miku AuahDark. #1482 #1460
-rw-r--r--src/lj_profile.c2
1 files changed, 1 insertions, 1 deletions
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)
359 ProfileState *ps = &profile_state; 359 ProfileState *ps = &profile_state;
360 global_State *g = ps->g; 360 global_State *g = ps->g;
361 if (G(L) == g) { /* Only stop profiler if started by this VM. */ 361 if (G(L) == g) { /* Only stop profiler if started by this VM. */
362 ps->g = NULL;
362 profile_timer_stop(ps); 363 profile_timer_stop(ps);
363 g->hookmask &= ~HOOK_PROFILE; 364 g->hookmask &= ~HOOK_PROFILE;
364 lj_dispatch_update(g, 0); 365 lj_dispatch_update(g, 0);
@@ -368,7 +369,6 @@ LUA_API void luaJIT_profile_stop(lua_State *L)
368#endif 369#endif
369 lj_buf_free(g, &ps->sb); 370 lj_buf_free(g, &ps->sb);
370 ps->sb.w = ps->sb.e = NULL; 371 ps->sb.w = ps->sb.e = NULL;
371 ps->g = NULL;
372 } 372 }
373} 373}
374 374