This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Class file generated by "gcj -C" throws ClassFormatError
- To: Weiqi Gao <weiqigao at yahoo dot com>, <java at gcc dot gnu dot org>
- Subject: Re: Class file generated by "gcj -C" throws ClassFormatError
- From: Pete Bevin <moose at bestiary dot com>
- Date: Fri, 22 Jun 2001 16:03:13 -0400
> class bar {
> static long x = 0;
> public static void main(String[] args) {
> }
> }
>
> The error is thrown if x is initialized with '0'. The
> error is not thrown if x is initialized with '0L' or
> not at all.
Seems that the ConstantValue attribute for the field "x" is pointing to a
Constant_Integer, not a Constant_Long in the "x = 0" case. Section 4.7.3 of
the vmspec specifies that it should match the field's type, not the
constant's.
How to fix? Dunno yet, parse.y is probably missing a promote_type()
somewhere.
Pete.