Skip to content

Commit

Permalink
FIXED: undo/1: calling hooks while backtracking could corrupt choicep…
Browse files Browse the repository at this point in the history
…oint.

Reported by Fernando Saenz Perez.
  • Loading branch information
JanWielemaker committed Oct 23, 2023
1 parent b4e4a19 commit 7f0b8ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pl-vmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6858,9 +6858,14 @@ VMH(deep_backtrack, 0, (), ())
if ( UNDO_SCHEDULED(LD) )
{ int rc;

lTop = (LocalFrame)(ch+1);
FR->clause = NULL;
if ( LD->mark_bar != NO_MARK_BAR )
LD->mark_bar = gTop;
SAVE_REGISTERS(QID);
rc = run_undo_hooks();
LOAD_REGISTERS(QID);
ch = BFR; /* can be shifted */
if ( !rc )
THROW_EXCEPTION;
}
Expand Down

0 comments on commit 7f0b8ab

Please sign in to comment.