[PATCH] Fix PR libgcj/36252, OutOfMemoryError in String constructor.
David Daney
ddaney@avtrex.com
Wed May 21 04:19:00 GMT 2008
Tom Tromey wrote:
>>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
>
> David> My patch to String's native code is simple and lets the String contain
> David> all the valid characters. Throwing away invalid data is contemplated
> David> and allowed by the specification.
>
> In that case, this is ok. Thanks for digging into the details.
> If you want to put this in 4.3, that is also ok by me.
>
Thanks,
Since I made a change to the testcase so it doesn't print a stack trace
if the character set converter is not available, I am attaching the
updated patch.
This is what I committed to both the 4.3 branch and trunk:
2008-05-20 David Daney <ddaney@avtrex.com>
PR libgcj/36252
* java/lang/natString.ccn: Add
#include <java/io/CharConversionException.h>.
(init (byte[], int, int, String)): Catch and ignore
CharConversionException. Break out of conversion loop
on incomplete input.
* testsuite/libjava.lang/PR36252.java: New test.
* testsuite/libjava.lang/PR36252.out: New file, its expected output.
* testsuite/libjava.lang/PR36252.jar: New file, its pre-compiled
jar file.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PR36252.patch
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20080521/1c8fe2bb/attachment.ksh>
More information about the Java-patches
mailing list