This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: [PATCH] Java - allow compiling a compressed .jar/.zip archive


Per Bothner wrote:
> I checked in the following.  It should allow compiling a compressed
> .jar or .zip archive.

I took another look at this patch:

> @@ -38,6 +42,7 @@ struct ZipDirectory {
>    unsigned size; /* length of file */
>    unsigned uncompressed_size; /* length of uncompressed data */
>    unsigned filestart;  /* start of file in archive */
> +  ZipFile *zipf;
>    int filename_length;
>    /* char mid_padding[...]; */
>    /* char filename[filename_length]; */

Here we change the size (and possibly alignment) of ZipDirectory. 
Instances of "struct ZipDirectory" are not allocated but assigned to a
buffer offset in zextract.c:

  320:       ZipDirectory *zipd = (ZipDirectory*)(dir_ptr +
dir_last_pad);

The dir_ptr array contents are read directly from a zip file.  I am very
skeptical that this is doing the right thing.  We may have gotten by
prior to this patch because the size and alignment of ZipDirectory just
happened to be consistent on all GCC platforms, but introducing a
pointer to the struct changes that.

Are compressed jar files an essential feature for 3.0?  I'm wondering if
this patch shouldn't be backed out until it can be studied some more.

Jeff

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