[m-rev.] for review: Bug fix in Java implementation of string library

James Goddard goddardjames at yahoo.com
Tue Dec 16 13:17:50 AEDT 2003


Estimated hours taken: 0.25
Branches: main

Fixed an off-by-one error that was creating exceptions.  The exception
was thrown when running tests/general/float_test.m

library/string.m:
	The bug was in this predicate:
		unsafe_substring/4

Index: string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.211
diff -u -d -r1.211 string.m
--- string.m	12 Dec 2003 05:33:11 -0000	1.211
+++ string.m	16 Dec 2003 02:12:15 -0000
@@ -3548,7 +3548,7 @@
 	string__unsafe_substring(Str::in, Start::in, Count::in, SubString::uo),
 	[will_not_call_mercury, promise_pure, thread_safe],
 "
-	SubString = Str.substring(Start, Start + Count + 1);
+	SubString = Str.substring(Start, Start + Count);
 ").
 
 /*
--------------------------------------------------------------------------
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