[m-rev.] diff: try syntax broke stm atomic goals

Peter Wang novalazy at gmail.com
Wed Mar 11 16:56:41 AEDT 2009


Branches: main

compiler/try_expand.m:
	Fix an oversight which made the `try' goal transformation abort
	whenever it came across an `atomic' goal.

diff --git a/compiler/try_expand.m b/compiler/try_expand.m
index f44c50d..ae3ade7 100644
--- a/compiler/try_expand.m
+++ b/compiler/try_expand.m
@@ -401,8 +401,14 @@ expand_try_goals_in_goal(Instmap, Goal0, Goal, !Info) :-
             ShortHand0 = try_goal(_, _, _),
             expand_try_goal(Instmap, ShortHand0, Goal, !Info)
         ;
-            ShortHand0 = atomic_goal(_, _, _, _, _, _, _),
-            unexpected(this_file, "expand_try_goals_in_goal: atomic_goal")
+            ShortHand0 = atomic_goal(AtomicGoalType, Outer, Inner,
+                MaybeOutputVars, MainGoal0, OrElseGoals0, OrElseInners),
+            expand_try_goals_in_goal(Instmap, MainGoal0, MainGoal, !Info),
+            expand_try_goals_in_disj(Instmap, OrElseGoals0, OrElseGoals,
+                !Info),
+            GoalExpr = atomic_goal(AtomicGoalType, Outer, Inner,
+                MaybeOutputVars, MainGoal, OrElseGoals, OrElseInners),
+            Goal = hlds_goal(shorthand(GoalExpr), GoalInfo0)
         ;
             ShortHand0 = bi_implication(_, _),
             unexpected(this_file, "expand_try_goals_in_goal: bi_implication")
--------------------------------------------------------------------------
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