[m-dev.] diff: fix `pragma loop_check' bug

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 29 16:52:37 AEST 1999


Estimated hours taken: 0.5

compiler/table_gen.m:
	Fix a bug:
	s/table_mark_as_succeeded/table_simple_mark_as_succeeded/

tests/tabling/Mmakefile:
tests/tabling/loopcheck.m:
tests/tabling/loopcheck.exp:
tests/tabling/loopcheck.exp2:
	Regression test.

Workspace: /home/mercury0/fjh/mercury
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.12
diff -u -d -r1.12 table_gen.m
--- table_gen.m	1999/10/03 04:15:26	1.12
+++ table_gen.m	1999/10/29 06:36:29
@@ -851,7 +851,7 @@
 	;
 		VarTypes = VarTypes0,
 		VarSet = VarSet0,
-		generate_call("table_mark_as_succeeded", [TableVar], det,
+		generate_call("table_simple_mark_as_succeeded", [TableVar], det,
 			impure, [], Module, Goal),
 		TableInfo = TableInfo0
 	).
Index: tests/tabling/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/tabling/Mmakefile,v
retrieving revision 1.8
diff -u -d -r1.8 Mmakefile
--- Mmakefile	1999/07/14 17:04:03	1.8
+++ Mmakefile	1999/10/29 06:42:01
@@ -8,7 +8,8 @@
 
 SIMPLE_PROGS = \
 	boyer \
-	fib
+	fib \
+	loopcheck
 
 NONDET_PROGS = \
 	coup \
@@ -49,6 +50,8 @@
 # (hence the leading `-')
 tc_loop.out: tc_loop
 	-./tc_loop > tc_loop.out 2>&1;
+loopcheck.out: loopcheck
+	-./loopcheck > loopcheck.out 2>&1;
 
 #-----------------------------------------------------------------------------#
 
Index: tests/tabling/loopcheck.exp
===================================================================
RCS file: loopcheck.exp
diff -N loopcheck.exp
--- /dev/null	Fri Oct 29 16:33:27 1999
+++ loopcheck.exp	Fri Oct 29 16:44:05 1999
@@ -0,0 +1,3 @@
+Uncaught exception:
+Software Error: detected infinite recursion in pred loopcheck:loop/1
+Stack dump not available in this grade.
Index: tests/tabling/loopcheck.exp2
===================================================================
RCS file: loopcheck.exp2
diff -N loopcheck.exp2
--- /dev/null	Fri Oct 29 16:33:27 1999
+++ loopcheck.exp2	Fri Oct 29 16:45:40 1999
@@ -0,0 +1,7 @@
+Uncaught exception:
+Software Error: detected infinite recursion in pred loopcheck:loop/1
+Stack dump follows:
+   0       pred exception:throw/1-0 (erroneous)
+   1       pred require:error/1-0 (erroneous)
+   2    2* pred loopcheck:loop/1-0 (erroneous)
+   4       pred loopcheck:main/2-0 (det)
Index: tests/tabling/loopcheck.m
===================================================================
RCS file: loopcheck.m
diff -N loopcheck.m
--- /dev/null	Fri Oct 29 16:33:27 1999
+++ loopcheck.m	Fri Oct 29 16:38:50 1999
@@ -0,0 +1,17 @@
+% Regression test.
+
+% rotd-1999-10-29 got a software error when compiling this test.
+
+:- module loopcheck.
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+main --> { loop(10) }, io__write_string("Hello, world\n").
+
+:- pragma loop_check(loop/1).
+:- pred loop(int::in) is erroneous.
+loop(X) :- loop(X).

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