[m-rev.] fix agc bug - restore original saved succip

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Dec 19 16:37:31 AEDT 2003


Estimated hours taken: 2
Branches: main

Fix another bug with LLDS accurate GC.

runtime/mercury_accurate_gc.c:
	When entering the garbage collector, make sure that we restore
	the original contents of the saved success location that we
	hijacked in order to schedule a collection.
	We need to do this if it was on the nondet stack, both because
	the collector may need it to traverse the nondet stack properly,
	and because the program may use it again after backtracking.

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.34
diff -u -d -r1.34 mercury_accurate_gc.c
--- runtime/mercury_accurate_gc.c	18 Dec 2003 14:47:55 -0000	1.34
+++ runtime/mercury_accurate_gc.c	19 Dec 2003 05:32:13 -0000
@@ -419,6 +419,13 @@
     /* record that the collector is running */
     gc_running = MR_TRUE;
 
+    /*
+    ** Restore the original contents of the saved success location.
+    ** This is needed in case it was on the nondet stack; in that
+    ** case, it might be used again after backtracking.
+    */
+    *saved_success_location = saved_success;
+
     MR_save_registers();
     MR_LLDS_garbage_collect(saved_success, callee_was_model_semi,
         MR_sp, MR_maxfr, MR_curfr);

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