for review: ite_gen.m bug fix

Fergus Henderson fjh at
Thu Jul 23 02:30:45 AEST 1998

Zoltan, can you please review this one?


Fix a bug introduced in zs's recent changes that broke

	When generating code for a negation, the condition
	should always be generated as a model_semi goal,
	even if the negation as a whole is model_det.

Index: ite_gen.m
RCS file: /home/staff/zs/imp/mercury/compiler/ite_gen.m,v
retrieving revision 1.56
diff -u -r1.56 ite_gen.m
--- ite_gen.m	1998/07/20 10:00:52	1.56
+++ ite_gen.m	1998/07/22 16:26:44
@@ -289,8 +289,10 @@
 	code_info__maybe_push_temp_frame(CodeModel, MayHijack,
 		HijackInfo, CurFrameLval, TempFrameCode),
-		% Generate the negated goal.
-	code_gen__generate_goal(CodeModel, Goal, GoalCode),
+		% Generate the negated goal as a semi-deterministic goal;
+		% it cannot be nondet, since mode correctness requires it
+		% to have no output vars.
+	code_gen__generate_goal(model_semi, Goal, GoalCode),
 	code_info__ite_enter_then(HijackInfo, CurFrameLval,
 		ThenNeckCode, ElseNeckCode),

Fergus Henderson <fjh at>  |  "I have always known that the pursuit
WWW: <>  |  of excellence is a lethal habit"
PGP: finger fjh at        |     -- the last words of T. S. Garp.

More information about the developers mailing list