From 7edca40761c6f87878367d53037a5a0dea2117ef Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 3 Aug 2022 06:56:57 +0200 Subject: psl-build.adb: disable incorrect optimization. Fix #2157 --- src/psl/psl-build.adb | 5 ++++- src/psl/psl-build.ads | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/psl') diff --git a/src/psl/psl-build.adb b/src/psl/psl-build.adb index 451466608..c9ae68d80 100644 --- a/src/psl/psl-build.adb +++ b/src/psl/psl-build.adb @@ -308,7 +308,10 @@ package body PSL.Build is Eps := Get_Epsilon_NFA (L) or Get_Epsilon_NFA (R); -- Optimize [*0] | R. - if Start_L = Final_L + -- TODO: this was not valid if there is an edge from Start(R) + -- to Start(R), like: {[*0] | {d[*]; e}} + if False + and then Start_L = Final_L and then Get_First_Src_Edge (Start_L) = No_Edge then if Start_R /= Final_R then diff --git a/src/psl/psl-build.ads b/src/psl/psl-build.ads index 9a2d05073..cf5053116 100644 --- a/src/psl/psl-build.ads +++ b/src/psl/psl-build.ads @@ -17,7 +17,7 @@ with PSL.Nodes; use PSL.Nodes; package PSL.Build is - Optimize_Final : Boolean := True; + Optimize_Final : constant Boolean := True; function Build_SERE_FA (N : Node) return NFA; function Build_FA (N : Node) return NFA; -- cgit v1.2.3