Class file generated by "gcj -C" throws ClassFormatError

Per Bothner per@bothner.com
Fri Jun 22 13:01:00 GMT 2001


Weiqi Gao <weiqigao@yahoo.com> writes:

> class foo {
>   static long x = 255;
>   public static void main(String[] args) {
>   }
> }
> ...
> Fields (count: 1):
> Field name:"x" static Signature: 6=long
> Attribute "ConstantValue", length:2, value: #8=<Integer 255>

I've verified this, and it definitely needs to be fixed.  It should be
easy and safe to fix this in generate_classfile, but I don't think
that is the correct fix.  I think parse.y needs to add a convert
somewhere; without it the tree structure is not type-correct.  I'm not
quite sure yet where to place the conversion.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Java mailing list