[m-rev.] fix LLDS agc off-by-one error

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Dec 19 03:06:38 AEDT 2003


Estimated hours taken: 3
Branches: main

Fix another LLDS accurate gc bug.

compiler/var_locn.m:
	Fix an off-by-one error: when reserving an extra word for a
	forwarding pointer, make sure to include the extra word in
	the size argument passed to MR_tag_offset_incr_hp.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: compiler/var_locn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/var_locn.m,v
retrieving revision 1.14
diff -u -d -r1.14 var_locn.m
--- compiler/var_locn.m	13 Nov 2003 09:51:23 -0000	1.14
+++ compiler/var_locn.m	18 Dec 2003 15:55:44 -0000
@@ -852,13 +852,15 @@
 			  "accurate GC combined with term size profiling")
 		;
 			TotalOffset = yes(1)
-		)
+		),
+		TotalSize = Size + 1
 	;
-		TotalOffset = MaybeOffset
+		TotalOffset = MaybeOffset,
+		TotalSize = Size
 	),
 	CellCode = node([
-		incr_hp(Lval, yes(Ptag), TotalOffset, const(int_const(Size)),
-			TypeMsg)
+		incr_hp(Lval, yes(Ptag), TotalOffset,
+			const(int_const(TotalSize)), TypeMsg)
 			- string__append("Allocating heap for ", VarName)
 	]),
 	var_locn__set_magic_var_location(Var, Lval, !VLI),

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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