[m-rev.] diff: fix ssdebug abort on nondet procedure

Peter Wang novalazy at gmail.com
Wed Aug 11 13:53:55 AEST 2010


Branches: main, 10.04

compiler/ssdebug.m:
        Fix overzealous assertion when the ssdebug transform encounters a
        procedure which is inferred semidet but declared nondet.

diff --git a/compiler/ssdebug.m b/compiler/ssdebug.m
index 5254b71..e413daa 100755
--- a/compiler/ssdebug.m
+++ b/compiler/ssdebug.m
@@ -670,22 +670,21 @@ process_proc_semi(PredId, ProcId, !ProcInfo, !ModuleInfo) :-
         % The condition of the if-then-else is the original body with renamed
         % output variables.  Introduce a promise_equivalent_solutions scope to
         % put it into a single solution context if the procedure (which we call
-        % recursively later) was declared to have more solutions.
+        % recursively later) was _declared_ to have more solutions.
         determinism_components(ProcDetism, _CanFail, Solns),
         (
             Solns = at_most_one,
             CondGoal = RenamedBodyGoal
         ;
-            Solns = at_most_many_cc,
+            ( Solns = at_most_many_cc
+            ; Solns = at_most_many
+            ),
             map.apply_to_list(OutputVars, Renaming, RenamedOutputVars),
             add_promise_equivalent_solutions(RenamedOutputVars,
                 RenamedBodyGoal, CondGoal)
         ;
-            ( Solns = at_most_zero
-            ; Solns = at_most_many
-            ),
-            unexpected(this_file,
-                "process_proc_semi: wrong number of solutions")
+            Solns = at_most_zero,
+            unexpected(this_file, "process_proc_semi: zero solutions")
         ),
 
         % Create the `then' branch.

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list