diff: bug fix for higher-order implied modes

Fergus Henderson fjh at hydra.cs.mu.oz.au
Wed Jul 2 18:26:25 AEST 1997


compiler/modecheck_call.m:
compiler/modecheck_unify.m:
	Fix a bug in the code to recompute the non-local variables
	when handling calls to higher-order predicates or functions
	in implied modes.

Index: modecheck_call.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/modecheck_call.m,v
retrieving revision 1.10
diff -u -r1.10 modecheck_call.m
--- modecheck_call.m	1997/05/21 02:13:38	1.10
+++ modecheck_call.m	1997/07/02 07:51:33
@@ -59,8 +59,9 @@
 
 	=(ModeInfo),
 	{ Call = higher_order_call(PredVar, Args, Types, Modes, Det) },
-	{ handle_extra_goals(Call, ExtraGoals, GoalInfo0, Args0, Args,
-				InstMap0, ModeInfo, Goal) },
+	{ handle_extra_goals(Call, ExtraGoals, GoalInfo0,
+			[PredVar | Args0], [PredVar | Args],
+			InstMap0, ModeInfo, Goal) },
 	mode_info_unset_call_context,
 	mode_checkpoint(exit, "higher-order predicate call").
 
Index: modecheck_unify.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.15
diff -u -r1.15 modecheck_unify.m
--- modecheck_unify.m	1997/05/30 17:16:47	1.15
+++ modecheck_unify.m	1997/07/02 07:52:43
@@ -634,7 +634,8 @@
 
 	=(ModeInfo),
 	{ Call = higher_order_call(FuncVar, Args, Types, Modes, Det) },
-	{ handle_extra_goals(Call, ExtraGoals, GoalInfo0, Args1, Args,
+	{ handle_extra_goals(Call, ExtraGoals, GoalInfo0,
+				[FuncVar | Args1], [FuncVar | Args],
 				InstMap0, ModeInfo, Goal) },
 
 	mode_info_unset_call_context,
-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list