]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Save trace recorder state around VM event call.
authorMike Pall <mike>
Sun, 16 Jan 2022 19:58:42 +0000 (20:58 +0100)
committerMike Pall <mike>
Sun, 16 Jan 2022 19:58:42 +0000 (20:58 +0100)
Reported by Sergey Kaplun.

src/lj_trace.c

index d4e7d5d42593e4c70408aa715c2dafc196cc6638..89c3c5ed1107af05883562d4cef15a015376fb05 100644 (file)
@@ -587,9 +587,11 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)
       trace_pendpatch(J, 0);
       setvmstate(J2G(J), RECORD);
       lj_vmevent_send_(L, RECORD,
-       /* Save/restore tmptv state for trace recorder. */
+       /* Save/restore state for trace recorder. */
        TValue savetv = J2G(J)->tmptv;
        TValue savetv2 = J2G(J)->tmptv2;
+       TraceNo parent = J->parent;
+       ExitNo exitno = J->exitno;
        setintV(L->top++, J->cur.traceno);
        setfuncV(L, L->top++, J->fn);
        setintV(L->top++, J->pt ? (int32_t)proto_bcpos(J->pt, J->pc) : -1);
@@ -597,6 +599,8 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)
       ,
        J2G(J)->tmptv = savetv;
        J2G(J)->tmptv2 = savetv2;
+       J->parent = parent;
+       J->exitno = exitno;
       );
       lj_record_ins(J);
       break;