Skip to content

Commit

Permalink
Avoid possible instantiation of Prolog data in the trace interception
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWielemaker committed Dec 4, 2023
1 parent e763cfd commit ada966b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/trace.pl
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@

user:prolog_trace_interception(Port, Frame, CHP, Action) :-
trace_pengines,
catch(trace_interception(Port, Frame, CHP, Action), E, true),
( var(E)
-> true
; abort % tracer ignores non-abort exceptions.
State = state(0),
( catch(trace_interception(Port, Frame, CHP, Action), E, true),
( var(E)
-> nb_setarg(1, State, Action)
; abort % tracer ignores non-abort exceptions.
),
fail
; arg(1, State, Action)
).

trace_interception(Port, Frame, _CHP, Action) :-
Expand Down

0 comments on commit ada966b

Please sign in to comment.