[m-rev.] diff: fix accumulator test case failure

Simon Taylor stayl at cs.mu.OZ.AU
Sat Jul 7 16:20:21 AEST 2001



Estimated hours taken: 0.25

compiler/hlds_out.m:
	Don't abort if the cons_id in a unify_rhs is a pred_const.

	Without this change tests/general/accumulator/highorder.m fails.

Index: hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.261
diff -u -u -r1.261 hlds_out.m
--- hlds_out.m	2001/06/04 03:26:51	1.261
+++ hlds_out.m	2001/07/07 05:30:01
@@ -2104,8 +2104,14 @@
 		hlds_out__write_functor(term__string(Str), ArgVars,
 			VarSet, AppendVarnums)
 	;
-		{ ConsId = pred_const(_, _, _) },
-		{ error("hlds_out__write_functor_cons_id: pred_const") }
+		{ ConsId = pred_const(PredId, _, _) },
+		{ module_info_pred_info(ModuleInfo, PredId, PredInfo) },
+		{ pred_info_module(PredInfo, PredModule) },
+		{ pred_info_name(PredInfo, PredName) },
+		hlds_out__write_functor_cons_id(
+			cons(qualified(PredModule, PredName),
+				list__length(ArgVars)),
+			ArgVars, VarSet, ModuleInfo, AppendVarnums)
 	;
 		{ ConsId = code_addr_const(_, _) },
 		{ error("hlds_out__write_functor_cons_id: code_addr_const") }
--------------------------------------------------------------------------
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