[m-dev.] diff: fix DD bug

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Fri Jul 2 16:27:38 AEST 1999


This is the fix for a bug that Fergus pointed out some time ago.  I'll
commit it after the tests in grade asm_fast have completed.

Cheers,
Mark.


Estimated hours taken: 6

trace/mercury_trace_declarative.c:
	Deep copy some data to the global heap, as it may need to be
	used after being backtracked over.

tests/debugger/declarative/Mmakefile:
	Re-enable the test that was failing due to this bug.

Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.2
diff -u -r1.2 Mmakefile
--- Mmakefile	1999/06/04 07:12:33	1.2
+++ Mmakefile	1999/07/01 06:46:06
@@ -17,14 +17,11 @@
 #-----------------------------------------------------------------------------#
 
 DECLARATIVE_PROGS= 		\
+	app			\
 	gcf			\
 	if_then_else		\
 	propositional		\
 	queens
-
-# XXX The following test (which fails) has been temporarily disabled
-# while a fix is being prepared:
-#	app 			\
 
 MCFLAGS = --trace deep --trace-decl
 MLFLAGS = --trace
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.8
diff -u -r1.8 mercury_trace_declarative.c
--- mercury_trace_declarative.c	1999/05/02 09:16:37	1.8
+++ mercury_trace_declarative.c	1999/07/02 04:29:49
@@ -38,8 +38,10 @@
 #include "mercury_trace_tables.h"
 #include "mercury_trace_util.h"
 #include "mercury_layout_util.h"
+#include "mercury_deep_copy.h"
 #include "mercury_string.h"
 #include "declarative_debugger.h"
+#include "std_util.h"
 #include <stdio.h>
 
 /*
@@ -381,6 +383,7 @@
 	Word				*base_sp;
 	Word				*base_curfr;
 	Word				*type_params;
+	Word				typeinfo_type;
 	int				i;
 
 	vars = &layout->MR_sll_var_info;
@@ -403,10 +406,20 @@
 	base_curfr = MR_saved_curfr(saved_regs);
 	type_params = MR_materialize_typeinfos_base(vars, saved_regs, 
 			base_sp, base_curfr);
+
+	MR_TRACE_CALL_MERCURY(
+		ML_get_type_info_for_type_info(&typeinfo_type);
+	);
+
 	for (i = 0; i < arg_count; i++) {
+		Word	arg_type;
+
 		MR_get_type_and_value_base(vars, i, saved_regs, base_sp,
-				base_curfr, type_params, &arg_types[i],
+				base_curfr, type_params, &arg_type,
 				&arg_values[i]);
+
+		arg_types[i] = MR_make_permanent(arg_type,
+					(Word *) typeinfo_type);
 
 #ifdef MR_DEBUG_DD_BACK_END
 		fprintf(MR_mdb_out, "\t");

-- 
Mark Brown, PhD student            )O+  |  "Another of Fortran's breakthroughs
(m.brown at cs.mu.oz.au)                   |  was the GOTO statement, which was...
Dept. of Computer Science and Software  |  uniquely simple and understandable"
Engineering, University of Melbourne    |              -- IEEE, 1994
--------------------------------------------------------------------------
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