From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28550 invoked by alias); 15 Jul 2005 08:52:15 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 28525 invoked by uid 48); 15 Jul 2005 08:52:13 -0000 Date: Fri, 15 Jul 2005 08:52:00 -0000 From: "i_mezhirov at yahoo dot com" To: java-prs@gcc.gnu.org Message-ID: <20050715085211.22496.i_mezhirov@yahoo.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/22496] New: accept-invalid: allows access to members as if they were static X-Bugzilla-Reason: CC X-SW-Source: 2005-q3/txt/msg00070.txt.bz2 List-Id: The code below is invalid, but GCJ compiles it. The resulting bytecode fails JVM verification; the generated native executable prints a random number. $ gcj -v Using built-in specs. Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../libgcj. spec rename spec lib to liborig Target: i686-pc-linux-gnu Configured with: ../gcc-4.0.0/configure Thread model: posix gcc version 4.0.0 $ gcj Test.java --main=Main ////////////////////////////////////////////// /// Test.java class Foo { int N = 10; } class Main { void printN() { System.out.println("N = " + Foo.N); // SHOULD BE AN ERROR } public static void main(String[] args) { Main main = new Main(); main.printN(); } } -- Summary: accept-invalid: allows access to members as if they were static Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: minor Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: i_mezhirov at yahoo dot com CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22496