Java PATCH for PR gcj/1200

Tom Tromey tromey@redhat.com
Fri Apr 6 09:52:00 GMT 2001


>>>>> "Joerg" == Joerg Brunsmann <joerg_brunsmann@yahoo.de> writes:

Joerg> the attached patch fixes PR gcj/1200 for this test case:

Do you have paperwork filed with the FSF?
We'll need that before we can check this in.

Joerg> 2001-04-06  Joerg Brunsmann  <joerg_brunsmann@yahoo.de>
 
Joerg>         * gjavah.c (is_throwable_subclass): New function.
Joerg>         (decode_signature_piece): Use it.
Joerg>         Fixes PR gcj/1200.

This patch largely looks ok.  However there are a few small problems
with it.

Joerg> +  for (;;) {

The open brace needs to be on its own line.

Joerg> +
Joerg> +  }
Joerg> +
Joerg> +}

The two blanks lines here can be removed.

Joerg> @@ -1083,8 +1193,7 @@ decode_signature_piece (stream, signatur
Joerg>           else if (! strncmp (signature, "Ljava/lang/Class;",
Joerg>                               sizeof ("Ljava/lang/Class;") - 1))
Joerg>             ctype = "jclass";
Joerg> -         else if (! strncmp (signature, "Ljava/lang/Throwable;",
Joerg> -                             sizeof ("Ljava/lang/Throwable;") - 1))
Joerg> +         else if (is_throwable_subclass (signature))
Joerg>             ctype = "jthrowable";
Joerg>           else if (! strncmp (signature, "Ljava/lang/ref/WeakReference;",
Joerg>                               sizeof ("Ljava/lang/ref/WeakReference;") - 1))                      

Just above this code is a FIXME comment which this patch invalidates.
Please remove that comment.

Also, your new code allocates memory in is_throwable_subclass() but
never frees it.  Anything allocated with ALLOC must be freed.  Also
you must call JCF_FINISH (&jcf) each time through the loop.

Could you make these changes and resubmit?

Thanks for this patch!

Tom



More information about the Gcc-patches mailing list