[m-rev.] For review: fix state variables bug

Ralph Becket rafe at cs.mu.OZ.AU
Fri May 2 10:32:52 AEST 2003


Estimated hours taken: 5
Branches: main

Fix a bug in the state variable transformation where incorrect state
variable numbering could cause the same name to be used twice.

compiler/make_hlds.m:
	Fixed reconciled_svar_infos/5 to ensure that the num field, used to
	number state variables, in the resulting svar_info is the maximum of
	the values of the num fields of the svar_infos being reconciled.

Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.437
diff -u -r1.437 make_hlds.m
--- compiler/make_hlds.m	15 Mar 2003 03:08:56 -0000	1.437
+++ compiler/make_hlds.m	1 May 2003 02:44:11 -0000
@@ -10001,11 +10001,12 @@
 			Dots,
 			SInfo0
 		 ),
-	SInfo  = set__fold(
+	SInfo2 = set__fold(
 			reconciled_svar_infos_colons(VarSet, SInfoX),
 			Colons,
 			SInfo1
-		 ).
+		 ),
+	SInfo  = ( SInfo2 ^ num := max(SInfo0 ^ num, SInfoX ^ num) ).
 
 
 :- func reconciled_svar_infos_dots(prog_varset, svar_info, svar, svar_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