diff options
author | Bryce McKinlay <bryce@albatross.co.nz> | 2000-05-20 23:30:46 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2000-05-21 00:30:46 +0100 |
commit | 1c02a3d9640482c8e296f4f939381fde52fd9b18 (patch) | |
tree | 88a48b421e4bd8ac7064e837896ccf0ff941907b | |
parent | dcfa721dcfd39c314d5dd8c3877c8ad6c79c5a24 (diff) | |
download | gcc-1c02a3d9640482c8e296f4f939381fde52fd9b18.zip gcc-1c02a3d9640482c8e296f4f939381fde52fd9b18.tar.gz gcc-1c02a3d9640482c8e296f4f939381fde52fd9b18.tar.bz2 |
re GNATS libgcj/226 (implicit __builtin_expect) and GNATS gcj/228 (compressed JAR files)
2000-05-20 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR libgcj/226:
* java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect,
since this is an installed header.
Fix for PR libgcj/228:
* java/util/zip/ZipFile (getInputStream): Create inflater with
nowrapper option.
* java/util/zip/natInflater.cc (inflate): Throw zlib's error message
with DataFormatException.
From-SVN: r34064
-rw-r--r-- | libjava/ChangeLog | 13 | ||||
-rw-r--r-- | libjava/java/lang/Class.h | 5 | ||||
-rw-r--r-- | libjava/java/util/zip/ZipFile.java | 4 | ||||
-rw-r--r-- | libjava/java/util/zip/natInflater.cc | 3 |
4 files changed, 21 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d544953..bd8c7fb 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,16 @@ +2000-05-20 Bryce McKinlay <bryce@albatross.co.nz> + + Fix for PR libgcj/226: + * java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect, + since this is an installed header. + + Fix for PR libgcj/228: + * java/util/zip/ZipFile (getInputStream): Create inflater with + nowrapper option. + + * java/util/zip/natInflater.cc (inflate): Throw zlib's error message + with DataFormatException. + 2000-05-20 Tom Tromey <tromey@cygnus.com> * Makefile.in: Rebuilt. diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 03fa439..31f143a 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -206,8 +206,9 @@ private: inline friend void _Jv_InitClass (jclass klass) { - if (__builtin_expect (klass->state != JV_STATE_DONE, false)) - klass->initializeClass (); + if (klass->state == JV_STATE_DONE) + return; + klass->initializeClass (); } friend _Jv_Method* _Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *, diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java index 5e01d57..7825786 100644 --- a/libjava/java/util/zip/ZipFile.java +++ b/libjava/java/util/zip/ZipFile.java @@ -133,7 +133,9 @@ public class ZipFile implements ZipConstants InputStream is = new ByteArrayInputStream (buffer); if (ze.getMethod() == ZipEntry.DEFLATED) - is = new InflaterInputStream (is); + // Data in zipfile entries does not have a zlib header, so construct + // an Inflater with the `nowrapper' option. + is = new InflaterInputStream (is, new Inflater (true), 512); return is; } diff --git a/libjava/java/util/zip/natInflater.cc b/libjava/java/util/zip/natInflater.cc index 312027a..f3d258c 100644 --- a/libjava/java/util/zip/natInflater.cc +++ b/libjava/java/util/zip/natInflater.cc @@ -117,7 +117,8 @@ java::util::zip::Inflater::inflate (jbyteArray buf, jint off, jint len) break; case Z_DATA_ERROR: - _Jv_Throw (new java::util::zip::DataFormatException); + _Jv_Throw (new java::util::zip::DataFormatException + (s->msg == NULL ? NULL : JvNewStringLatin1 (s->msg))); break; case Z_MEM_ERROR: |