This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: I need an advice
- To: Martin Kahlert <martin dot kahlert at infineon dot com>
- Subject: Re: I need an advice
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Fri, 17 Aug 2001 12:41:52 -0400 (EDT)
- cc: java at gcc dot gnu dot org
On Fri, 17 Aug 2001, Martin Kahlert wrote:
> at 0x401560f6: _Jv_ThrowBadArrayIndex (/sw/snapshots/lib/libgcj.so.2)
> at 0x402598f9: gnu.gcj.convert.Output_UTF8.write(char[], int, int) (/sw/snapshots/lib/libgcj.so.2)
> at 0x40259a8c: gnu.gcj.convert.UnicodeToBytes.write(java.lang.String, int, int, char[]) (/sw/snapshots/lib/libgcj.so.2)
> at 0x401a4cdd: java.io.PrintStream.writeChars(java.lang.String, int, int) (/sw/snapshots/lib/libgcj.so.2)
Ah-hah. I got this too but didn't quite understand what triggered it.
Try this patch:
2001-08-17 Jeff Sturm <jsturm@one-point.com>
* gnu/gcj/convert/UnicodeToBytes.java (write): Write work buffer
starting from zero offset.
Index: gnu/gcj/convert/UnicodeToBytes.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/convert/UnicodeToBytes.java,v
retrieving revision 1.8
diff -u -r1.8 UnicodeToBytes.java
--- UnicodeToBytes.java 2001/07/30 20:24:18 1.8
+++ UnicodeToBytes.java 2001/08/17 16:34:40
@@ -143,7 +143,7 @@
work = new char[inlength];
int srcEnd = inpos + (inlength > work.length ? work.length : inlength);
str.getChars(inpos, srcEnd, work, 0);
- return write(work, inpos, inlength);
+ return write(work, 0, inlength);
}
/** Indicate that the converter is resuable.