Commit 1c02a3d9 by Bryce McKinlay Committed by Bryce McKinlay

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
parent dcfa721d
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> 2000-05-20 Tom Tromey <tromey@cygnus.com>
* Makefile.in: Rebuilt. * Makefile.in: Rebuilt.
......
...@@ -206,8 +206,9 @@ private: ...@@ -206,8 +206,9 @@ private:
inline friend void inline friend void
_Jv_InitClass (jclass klass) _Jv_InitClass (jclass klass)
{ {
if (__builtin_expect (klass->state != JV_STATE_DONE, false)) if (klass->state == JV_STATE_DONE)
klass->initializeClass (); return;
klass->initializeClass ();
} }
friend _Jv_Method* _Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *, friend _Jv_Method* _Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *,
......
...@@ -133,7 +133,9 @@ public class ZipFile implements ZipConstants ...@@ -133,7 +133,9 @@ public class ZipFile implements ZipConstants
InputStream is = new ByteArrayInputStream (buffer); InputStream is = new ByteArrayInputStream (buffer);
if (ze.getMethod() == ZipEntry.DEFLATED) 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; return is;
} }
......
...@@ -117,7 +117,8 @@ java::util::zip::Inflater::inflate (jbyteArray buf, jint off, jint len) ...@@ -117,7 +117,8 @@ java::util::zip::Inflater::inflate (jbyteArray buf, jint off, jint len)
break; break;
case Z_DATA_ERROR: 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; break;
case Z_MEM_ERROR: case Z_MEM_ERROR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment