diff: fix bug with REDO events on SPARCs

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 11 00:39:43 AEDT 1998


Estimated hours taken: 1

Fix a bug that broke tracing of REDO events on SPARCs.

runtime/mercury_trace_base.c:
	In MR_do_trace_redo_fail, call save/restore_transient_registers()
	before/after the call to MR_trace().  Also, change the code to
	handle the jump address returned from MR_trace().
	These bugs crept in because in the past we made changes to
	the way MR_trace() was called in compiler/trace.m but we forgot
	to also update this hard-coded call to MR_trace().

Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.6
diff -u -r1.6 mercury_trace_base.c
--- mercury_trace_base.c	1998/11/09 05:20:43	1.6
+++ mercury_trace_base.c	1998/11/10 13:31:29
@@ -281,9 +281,15 @@
 	printf("MR_redo_layout_framevar(MR_redofr_slot(MR_curfr) = %p\n",
 		MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)));
 #endif
-	MR_trace((const MR_Stack_Layout_Label *)
-		MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)),
-		MR_PORT_REDO, "", 0);
+	{
+		Code *MR_jumpaddr;
+		save_transient_registers();
+		MR_jumpaddr = MR_trace((const MR_Stack_Layout_Label *)
+			MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)),
+			MR_PORT_REDO, "", 0);
+		restore_transient_registers();
+		if (MR_jumpaddr != NULL) GOTO(MR_jumpaddr);
+	}
 	fail();
 
 END_MODULE


-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list