This is the mail archive of the java-prs@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]

java/2658: Inner class with initializer block emits bad code



>Number:         2658
>Category:       java
>Synopsis:       Inner class with initializer block emits bad code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 26 13:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     alk@pobox.com
>Release:        HEAD and gcc 3.0 branch 26 Apr 2001
>Organization:
>Environment:
i686-pc-linux-gnu, and i686-pc-cygwin
>Description:
/*

% gcj -o Toy.x --main=Toy Toy.java; ./Toy.x

Exception in thread "main" java.lang.NullPointerException 
   at 0x4016802c: _Jv_ThrowSignal (/usr/local/pkgs/gcc/lib/libgcj.so.2) 
   at 0x4016806d: _Jv_ThrowSignal (/usr/local/pkgs/gcc/lib/libgcj.so.2) 
   at 0x08048a0b: Toy__U24_Inner.finit__U24_() (/home/tony/w/Swarmcast/build/native/bugs/Toy.java:5) 
   at 0x08048a3f: Toy__U24_Inner.Toy__U24_Inner(Toy) (/home/tony/w/Swarmcast/build/native/bugs/Toy.java:4) 
   at 0x08048ab5: Toy.Toy() (/home/tony/w/Swarmcast/build/native/bugs/Toy.java:10) 
   at 0x08048b34: Toy.main(java.lang.String[]) (/home/tony/w/Swarmcast/build/native/bugs/Toy.java:15) 
   at 0x4017ee0b: gnu.gcj.runtime.FirstThread.run() (/usr/local/pkgs/gcc/lib/libgcj.so.2) 
   at 0x4018a2ab: java.lang.Thread.run_(java.lang.Object) (/usr/local/pkgs/gcc/lib/libgcj.so.2) 
   at 0x4029c385: _Jv_ThreadSetPriority(_Jv_Thread_t, int) (/usr/local/pkgs/gcc/lib/libgcj.so.2) 
   at 0x4044761c: GC_start_routine (/usr/local/pkgs/gcc/lib/libgcjgc.so.1) 
   at 0x4046060e: pthread_detach (/lib/libpthread.so.0) 
   at 0x4055edaa: __clone (/lib/libc.so.6) 

*/

public class Toy {
	protected int outer_var = 0;
		
	class Inner {
		private int inner_var = outer_var;
		Inner()	{ };
	};
	
	public Toy() {
		Inner inner = new Inner();
		System.out.println("okay");
	};

	public static void main(String args[]) {
		Toy instance = new Toy();
	};
};

>How-To-Repeat:
See descr.
>Fix:
Probably related to changing the code modified by 
the patch associated with PR/1315
>Release-Note:
>Audit-Trail:
>Unformatted:


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