public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "greenrd at greenrd dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/17020] New: gij should ignore all reserved method flags
Date: Fri, 13 Aug 2004 17:17:00 -0000	[thread overview]
Message-ID: <20040813171711.17020.greenrd@greenrd.org> (raw)

The JVM spec says, in section 4.6 relating to method access flags:

"All bits of the access_flags item not assigned in Table 4.5 are reserved for
future use. They should be set to zero in generated class files and should be
ignored by Java virtual machine implementations." [0]

However, gij does not follow this spec. It contains this code in
libjava/defineclass.cc :

  1253        if (method->accflags & (Modifier::VOLATILE
  1254                                | Modifier::TRANSIENT
  1255                                | Modifier::INTERFACE))
  1256          throw_class_format_error ("erroneous method access flags");

This becomes a problem when a method using covariant return types is compiled by
JDK 1.5 beta, passed through Retroweaver[1] to make it "Java
1.4-bytecode-compatible", and then run by gij - because Retroweaver
sometimes/always leaves the undocumented 0x40 flag set for covariant bridge
methods. (0x40 is interpreted by gcj as VOLATILE, but 0x40 is not in Table 4.5
in the spec, so it should not be rejected by gij.)

Although probably Retroweaver shouldn't do that (and I'll file a bug against
Retroweaver about that), gij should still accept it when it does.

[0] http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#1513
[1] http://retroweaver.sourceforge.net/

-- 
           Summary: gij should ignore all reserved method flags
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: greenrd at greenrd dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17020


             reply	other threads:[~2004-08-13 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-13 17:17 greenrd at greenrd dot org [this message]
2004-08-13 17:28 ` [Bug libgcj/17020] " pinskia at gcc dot gnu dot org
2004-08-13 18:26 ` cvs-commit at gcc dot gnu dot org
2004-08-13 18:26 ` mckinlay at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040813171711.17020.greenrd@greenrd.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).