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

James Goddard goddardjames at yahoo.com
Tue Dec 16 14:33:15 AEDT 2003


Estimated hours taken: 0.25
Branches: main

Bug fix for library functions for the string library in java.

library/string.m:
	The following predicate was off-by-one (The upper bound was one
	higher than it should have been, which caused a
	StringIndexOutOfBoundsException in tests/float_test):
		string__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