Skip to content

Commit a2c32e5

Browse files
committed
Adalog: let Timeout_Error propagate in Has_Contradiction
Has_Contradiction is supposed to catch all the exceptions that predicates may raise, but it should not catch Timeout_Errors, as Evaluate_Atoms uses that exception in order to completely abort the solver. TN: SB20-024
1 parent b86f000 commit a2c32e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

support/langkit_support-adalog-solver.adb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,16 @@ package body Langkit_Support.Adalog.Solver is
933933
-- this case, even though we know that the solver will later fail
934934
-- evaluating the same atom, we cannot optimize it out to preserve
935935
-- the order in which the solver finds solutions.
936+
--
937+
-- Do not catch the Timeout_Error exception, as it is not supposed to
938+
-- be raised by predicates: it's the solver that aborts solving.
936939

937940
begin
938941
Result := not Evaluate_Atoms (Ctx, Sorted_Atoms);
939942
exception
943+
when Timeout_Error =>
944+
raise;
945+
940946
when E : others =>
941947
Save_Occurrence (Exc, E);
942948
Had_Exception := True;

0 commit comments

Comments
 (0)