public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/17020] New: gij should ignore all reserved method flags
@ 2004-08-13 17:17 greenrd at greenrd dot org
  2004-08-13 17:28 ` [Bug libgcj/17020] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: greenrd at greenrd dot org @ 2004-08-13 17:17 UTC (permalink / raw)
  To: java-prs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-13 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 17:17 [Bug libgcj/17020] New: gij should ignore all reserved method flags greenrd at greenrd dot org
2004-08-13 17:28 ` [Bug libgcj/17020] " pinskia at gcc dot gnu dot org
2004-08-13 18:26 ` mckinlay at redhat dot com
2004-08-13 18:26 ` cvs-commit at gcc dot gnu dot org

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).