mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Save trace recorder state around VM event call.
Reported by Sergey Kaplun.
This commit is contained in:
parent
c4dfb625ba
commit
b5b20191f3
@ -587,9 +587,11 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)
|
|||||||
trace_pendpatch(J, 0);
|
trace_pendpatch(J, 0);
|
||||||
setvmstate(J2G(J), RECORD);
|
setvmstate(J2G(J), RECORD);
|
||||||
lj_vmevent_send_(L, 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 savetv = J2G(J)->tmptv;
|
||||||
TValue savetv2 = J2G(J)->tmptv2;
|
TValue savetv2 = J2G(J)->tmptv2;
|
||||||
|
TraceNo parent = J->parent;
|
||||||
|
ExitNo exitno = J->exitno;
|
||||||
setintV(L->top++, J->cur.traceno);
|
setintV(L->top++, J->cur.traceno);
|
||||||
setfuncV(L, L->top++, J->fn);
|
setfuncV(L, L->top++, J->fn);
|
||||||
setintV(L->top++, J->pt ? (int32_t)proto_bcpos(J->pt, J->pc) : -1);
|
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)->tmptv = savetv;
|
||||||
J2G(J)->tmptv2 = savetv2;
|
J2G(J)->tmptv2 = savetv2;
|
||||||
|
J->parent = parent;
|
||||||
|
J->exitno = exitno;
|
||||||
);
|
);
|
||||||
lj_record_ins(J);
|
lj_record_ins(J);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user