[Bug java/12857] Illegal method modifier when loading a generated .class

jsturm at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Nov 15 05:29:00 GMT 2003


------- Additional Comments From jsturm at gcc dot gnu dot org  2003-11-15 05:29 -------
(In reply to comment #4)
> Jeff, how did the testing go?

I get a miscompilation of java.io.ObjectStreamClass during bootstrap,
introducing 10 new Mauve failures.   The .class file is created with fields in
the exact opposite of their declared order.

The cause is a bit surprising to me.  On the surface the source parser looks as
though it would be reentrant, but it is not.  Moving build_dot_class_method to
pass 1 causes load_class to be used, which may invoke the parser again (though
only during bootstrap when some class files are not available).

So java_reorder_fields is called prematurely on java.io.ObjectStreamClass, when
no fields are yet defined.

Should be fixable by either:
1) Moving build_dot_class_method back to pass 2 (patch_incomplete_class_ref), or
2) Modifying build_dot_class_method to not invoke load_class.

Overall I'm inclined to attempt 2), since the creation of 'class$' may occur in
an anonymous class, and all other inner classes are created in pass 1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aph at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list