This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New Miscompilation Into Bytecode Error


>>>>> "Stephan" == sf  <sf@b-i-t.de> writes:

>> Hello$1$Local(Hello,int,int);
>> Code:
>> 0:   aload_0
>> 1:   aload_1
>> 2:   putfield        #14; //Field this$0:LHello;

Stephan> The initializer must be called first (I think).

There's actually a special case for assignment to fields declared in
this class -- you can have those assignments before the super call.
This was introduced to let constructors set up `this$0' and friends so
that other methods called by the constructor wouldn't fail with a
cryptic NullPointerException.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]