[m-rev.] diff: fix declarative debugging test case failures

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Jul 30 20:24:19 AEST 2002


browser/util.m:
	Fix a bug: call_trace_getline now may call Mercury. Asserting
	will_not_call_mercury was causing succip to be clobbered,
	which lead to test case failures whose symtom was that the
	declarative debugger did not report the bug it found.

Zoltan.

cvs diff: Diffing .
Index: util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/util.m,v
retrieving revision 1.17
diff -u -b -r1.17 util.m
--- util.m	23 Jul 2002 02:30:55 -0000	1.17
+++ util.m	30 Jul 2002 10:10:49 -0000
@@ -91,16 +91,14 @@
 
 util__trace_getline(Prompt, Result, MdbIn, MdbOut) -->
 	call_trace_getline(MdbIn, MdbOut, Prompt, Line, Success),
-	{
-		Success = yes,
+	{ Success > 0 ->
 		Result = ok(Line)
 	;
-		Success = no,
 		Result = eof
 	}.
 
 :- pred call_trace_getline(input_stream::in, output_stream::in, string::in,
-	string::out, bool::out, io__state::di, io__state::uo) is det.
+	string::out, int::out, io__state::di, io__state::uo) is det.
 
 :- pragma c_header_code("
 	#include ""mercury_wrapper.h""
@@ -130,11 +128,11 @@
 	if (line == NULL) {
 		/* we copy the null string to avoid warnings about const */
 		MR_make_aligned_string_copy(Line, """");
-		Success = ML_bool_return_no();
+		Success = 0;
 	} else {
 		MR_make_aligned_string_copy(Line, line);
 		MR_free(line);
-		Success = ML_bool_return_yes();
+		Success = 1;
 	}
 ").
 
--------------------------------------------------------------------------
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