[m-rev.] diff: fix agc extra roots bug

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 17 21:22:48 AEDT 2003


Estimated hours taken: 2 (plus about 24 hacking valgrind)
Branches: main

runtime/mercury_accurate_gc.c:
	Fix a bug: the "next" field on the list of extra roots was
	not being initialized.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: runtime/mercury_accurate_gc.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_accurate_gc.c,v
retrieving revision 1.32
diff -u -d -u -7 -r1.32 mercury_accurate_gc.c
--- runtime/mercury_accurate_gc.c	18 Nov 2003 07:02:28 -0000	1.32
+++ runtime/mercury_accurate_gc.c	17 Dec 2003 10:06:15 -0000
@@ -1005,19 +1005,19 @@
 MR_agc_add_root(MR_Word *root_addr, MR_TypeInfo type_info)
 {
     MR_RootList node;
 
     node = MR_malloc(sizeof(*node));
     node->root = root_addr;
     node->type_info = type_info;
+    node->next = NULL;
 
     if (root_list == NULL) {
         root_list = node;
         last_root = node;
-        last_root->next = NULL;
     } else {
         last_root->next = node;
         last_root = node;
     }
 }
 
 #endif /* MR_NATIVE_GC */
-- 
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