for review: bug fix for semidet pragma c_code

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 15 15:30:33 AEDT 1998


On 15-Jan-1998, I wrote:
> Zoltan, can you please review this one?
> 
> --------------------
> 
> Fix a bug where semidet pragma c_codes didn't work in non-gc grades.

More testing revealed that this bug fix happened to trigger another bug.

compiler/dupelim.m:
	Fix a bug in dupelim__build_maps: a lambda expression was using
	the same variable name (`Label') as the code outside it,
	resulting in it accidentally capturing that variable rather
	than being a fresh variable.

Index: dupelim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dupelim.m,v
retrieving revision 1.30
diff -u -u -r1.30 dupelim.m
--- dupelim.m	1998/01/13 10:11:50	1.30
+++ dupelim.m	1998/01/15 04:21:17
@@ -114,8 +114,8 @@
 	),
 	AddPragmaReferredLabels = lambda(
 		[Instr::in, FoldFixed0::in, FoldFixed::out] is det, (
-		( Instr = pragma_c(_, _, _, yes(Label)) - _ ->
-			set__insert(FoldFixed0, Label, FoldFixed)
+		( Instr = pragma_c(_, _, _, yes(PragmaLabel)) - _ ->
+			set__insert(FoldFixed0, PragmaLabel, FoldFixed)
 		;
 			FoldFixed = FoldFixed0
 		)

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