[m-rev.] diff: fix saved_vars.m

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed May 14 17:00:23 AEST 2003


compiler/saved_vars.m:
	Fix a bug exposed by my change to table_gen.m: do not duplicate
	unifications with features such as call_table_gen.

Zoltan.

cvs diff: Diffing .
Index: saved_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/saved_vars.m,v
retrieving revision 1.34
diff -u -b -r1.34 saved_vars.m
--- saved_vars.m	15 Mar 2003 03:09:09 -0000	1.34
+++ saved_vars.m	14 May 2003 04:24:09 -0000
@@ -171,11 +171,15 @@
 saved_vars_in_conj([Goal0 | Goals0], NonLocals, SlotInfo0,
 		Goals, SlotInfo) :-
 	(
-		Goal0 = unify(_, _, _, Unif, _) - _,
+		Goal0 = unify(_, _, _, Unif, _) - GoalInfo,
 		Unif = construct(Var, _, [], _, _, _, _),
 		skip_constant_constructs(Goals0, Constants, Others),
 		Others = [First | _Rest],
-		can_push(Var, First)
+		can_push(Var, First),
+		goal_info_get_features(GoalInfo, Features),
+		% If the goal has a feature such as call_table_gen or impure,
+		% we don't want to duplicate it.
+		set__empty(Features)
 	->
 		set__is_member(Var, NonLocals, IsNonLocal),
 		saved_vars_delay_goal(Others, Goal0, Var, IsNonLocal,
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list