This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in `display'


Dr. M. Luedde wrote:
#|kawa:1|# (define (test-display)
(let loop ( (x '()) (n 200) )
(if (zero? n) (display x)
(loop (cons n (list x)) (- n 1)))))
#|kawa:2|# (test-display)
leads to java.lang.ArrayIndexOutOfBoundsException
Thanks - that was a helpful testcase!  There have been
previous bug reports that might well be the same bug.

I checked in the appended patch.
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Index: PrettyWriter.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/text/PrettyWriter.java,v
retrieving revision 1.4
diff -u -r1.4 PrettyWriter.java
--- PrettyWriter.java	3 Oct 2001 00:00:45 -0000	1.4
+++ PrettyWriter.java	2 Jun 2002 21:00:50 -0000
@@ -363,7 +363,7 @@
     return addr;
   }
 
-  /** Calculate howmuch space to allocate for a buffer.
+  /** Calculate how much space to allocate for a buffer.
    * @param current the current size of the buffer
    * @param want how much more space is needed
    */
@@ -959,7 +959,7 @@
       }
     System.arraycopy(buffer, amountToConsume, newBuffer, prefixLen,
 		     fillPtr - amountToConsume);
-    System.arraycopy(prefix, 0, buffer, 0, prefixLen);
+    System.arraycopy(prefix, 0, newBuffer, 0, prefixLen);
     bufferFillPointer = newFillPtr;
     bufferOffset += shift;
     if (! isLiteral)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]