[m-rev.] diff: bug fix for higher_order.m

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jul 13 22:16:52 AEST 2001


Estimated hours taken: 1
Branches: main

compiler/higher_order.m:
	Fix up the uni_modes field of specialized constructions of
	higher-order terms. This fixes a compiler abort when compiling
	tests/hard_coded/type_spec_ho_term.m in grade hlc.gc.


Index: higher_order.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -u -r1.89 -r1.90
--- higher_order.m	2001/07/10 10:45:21	1.89
+++ higher_order.m	2001/07/13 12:15:50	1.90
@@ -1078,7 +1078,7 @@
 	ProcInfo0 =^ proc_info,
 	( 
 		{ Goal0 = unify(_, _, UniMode, Unify0, Context) },
-		{ Unify0 = construct(LVar, ConsId0, Args0, UniModes,
+		{ Unify0 = construct(LVar, ConsId0, Args0, _,
 				HowToConstruct, CellIsUnique, MaybeExprn) },
 		{ ConsId0 = pred_const(PredId, ProcId, EvalMethod) },
 		{ map__contains(NewPreds, proc(PredId, ProcId)) },
@@ -1121,6 +1121,20 @@
 			;
 				error("maybe_specialize_pred_const")	
 			},
+
+			{ module_info_pred_proc_info(ModuleInfo,
+				NewPredId, NewProcId, _, NewCalleeProcInfo) },
+			{ proc_info_argmodes(NewCalleeProcInfo,
+				NewCalleeArgModes) },
+			{	list__take(list__length(NewArgs),
+					NewCalleeArgModes, CurriedArgModes0)
+			->
+				CurriedArgModes = CurriedArgModes0
+			;
+				error("maybe_specialize_pred_const")
+			},
+			{ mode_util__modes_to_uni_modes(CurriedArgModes,
+				CurriedArgModes, ModuleInfo, UniModes) },
 				
 			% The dummy arguments can't be used anywhere.
 			ProcInfo2 =^ proc_info,
--------------------------------------------------------------------------
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