diff options
author | Mike Pall <mike> | 2022-01-16 20:58:42 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2022-01-16 20:58:42 +0100 |
commit | b5b20191f3a8a2e2d28f1362b11bd26a51083d89 (patch) | |
tree | f05f0524dcbbfe61c49e96de7f5cf042275130ab | |
parent | c4dfb625bad8937d72074852a977738ec3eb1ab7 (diff) | |
download | luajit2-b5b20191f3a8a2e2d28f1362b11bd26a51083d89.tar.gz |
Save trace recorder state around VM event call.
Reported by Sergey Kaplun.
-rw-r--r-- | src/lj_trace.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c index d4e7d5d4..89c3c5ed 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c @@ -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; |