[m-dev.] diff: fix trail ticket counter bug in call_engine()

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Apr 17 20:45:51 AEST 2000


Estimated hours taken: 0.5

runtime/mercury_engine.c:
	Fix a bug: if the routine exits without throwing an exception, then
	the trail ticked should only be pruned, not discarded; tickets should
	only be discarded on backtracking.

Workspace: /home/mercury0/fjh/mercury
Index: runtime/mercury_engine.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.c,v
retrieving revision 1.22
diff -u -d -r1.22 mercury_engine.c
--- runtime/mercury_engine.c	2000/03/31 08:59:25	1.22
+++ runtime/mercury_engine.c	2000/04/02 16:59:44
@@ -277,14 +277,14 @@
 			** If we added an exception hander, but we didn't
 			** get an exception, then we need to remove the
 			** exception handler frames from the nondet stack
-			** and deallocate the trail ticket allocated by
+			** and prune the trail ticket allocated by
 			** MR_create_exception_handler().
 			*/
 			this_frame = MR_curfr;
 			MR_maxfr = MR_prevfr_slot(this_frame);
 			MR_curfr = MR_succfr_slot(this_frame);
 #ifdef MR_USE_TRAIL
-			MR_discard_ticket();
+			MR_prune_ticket();
 #endif
 		}
 		return NULL;

-- 
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list