[m-rev.] diff: fix hlc.gc.memprof bug

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Dec 10 13:00:38 AEDT 2001


Branches: main
Estimated hours taken: 1

Fix a bug that broke grade `hlc.gc.memprof'.

compiler/mlds_to_c.m:
	Use an empty string, rather than a null pointer, when generating
	calls to MR_record_allocation for allocations where the
	`maybe(ctor_name)' field in the `new_object' instruction is `no'.

Workspace: /home/earth/fjh/ws-earth3/mercury
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.109
diff -u -d -r1.109 mlds_to_c.m
--- compiler/mlds_to_c.m	8 Nov 2001 11:47:59 -0000	1.109
+++ compiler/mlds_to_c.m	10 Dec 2001 00:55:29 -0000
@@ -2378,7 +2378,12 @@
 			c_util__output_quoted_string(CtorName),
 			io__write_char('"')
 		;
-			io__write_string("NULL")
+			/*
+			** Just use an empty string.  Note that we can't use
+			** a null pointer here, because MR_record_allocation()
+			** requires its string arguments to not be NULL.
+			*/
+			io__write_string("\"\"")
 		),
 		io__write_string(");\n")
 	;

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