[m-rev.] diff: fix setting goal_type bug for clauses

Peter Ross pro at missioncriticalit.com
Tue Jun 11 01:15:07 AEST 2002


Hi,


===================================================================


Estimated hours taken: 1
Branches: main

compiler/make_hlds.m:
	Fix a bug where clauses which are defined as both a pragma foreign_code
	and a mercury clause were incorrectly having their goal_type set to
	clauses.

Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.412
diff -u -r1.412 make_hlds.m
--- compiler/make_hlds.m	1 Jun 2002 13:34:34 -0000	1.412
+++ compiler/make_hlds.m	10 Jun 2002 15:12:30 -0000
@@ -3861,7 +3861,14 @@
 			pred_info_set_goal_type(PredInfo3, promise(PromiseType),
 					PredInfo4)
 		;
-			pred_info_set_goal_type(PredInfo3, clauses, PredInfo4)
+			HaveForeignClauses = Clauses ^ have_foreign_clauses,
+			( HaveForeignClauses = yes,
+				NewGoalType = clauses_and_pragmas
+			; HaveForeignClauses = no,
+				NewGoalType = clauses
+			),
+			pred_info_set_goal_type(PredInfo3,
+					NewGoalType, PredInfo4)
 		),
 		pred_info_set_typevarset(PredInfo4, TVarSet, PredInfo5),
 		pred_info_arg_types(PredInfo5, _ArgTVarSet,

--------------------------------------------------------------------------
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