diff options
author | Mark Wielaard <mark@klomp.org> | 2006-08-07 22:13:06 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-08-07 22:13:06 +0000 |
commit | 5dd796b02c0f49d5efe25df775d3870d881cfb01 (patch) | |
tree | 6e1c00a72712eb351ce2ab7e0ad3fcda2e3f23bf | |
parent | 20281a9d68dc797fdb47b42c55346c12ebe91930 (diff) | |
download | classpath-5dd796b02c0f49d5efe25df775d3870d881cfb01.tar.gz |
2006-08-07 C. Scott Marshall <csm@gnu.org>
Fixes PR 28608.
* java/nio/DirectByteBufferImpl.java (duplicate): only reset if
the mark has been set.
* native/jni/java-nio/java_nio_VMDirectByteBuffer.c
(Java_java_nio_VMDirectByteBuffer_allocate): zero out the
allocated data.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | java/nio/DirectByteBufferImpl.java | 1 | ||||
-rw-r--r-- | native/jni/java-nio/java_nio_VMDirectByteBuffer.c | 2 |
3 files changed, 13 insertions, 1 deletions
@@ -1,4 +1,13 @@ -2006-08-07 Sven de Marothy <sven@physto.se> +2006-08-07 C. Scott Marshall <csm@gnu.org> + + Fixes PR 28608. + * java/nio/DirectByteBufferImpl.java (duplicate): only reset if + the mark has been set. + * native/jni/java-nio/java_nio_VMDirectByteBuffer.c + (Java_java_nio_VMDirectByteBuffer_allocate): zero out the + allocated data. + +2006-08-07 Sven de Marothy <sven@physto.se> * gnu/java/awt/peer/gtk/CairoGraphics2D.java (drawGlyphVector): Synchronize against font object when drawing. diff --git a/java/nio/DirectByteBufferImpl.java b/java/nio/DirectByteBufferImpl.java index 53bb668aa..3a9036f31 100644 --- a/java/nio/DirectByteBufferImpl.java +++ b/java/nio/DirectByteBufferImpl.java @@ -232,6 +232,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer private ByteBuffer duplicate(boolean readOnly) { int pos = position(); + if (this.mark != -1) reset(); int mark = position(); position(pos); diff --git a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c index f725cf2a4..bfee7e9dc 100644 --- a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c +++ b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c @@ -60,6 +60,8 @@ Java_java_nio_VMDirectByteBuffer_allocate return 0; } + memset (buffer, 0, capacity); + return JCL_NewRawDataObject (env, buffer); } |