Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 33778 invoked from network); 8 Nov 2006 09:47:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2006 09:47:12 -0000 Received: (qmail 85696 invoked by uid 500); 8 Nov 2006 09:47:23 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 85596 invoked by uid 500); 8 Nov 2006 09:47:23 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 85576 invoked by uid 99); 8 Nov 2006 09:47:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Nov 2006 01:47:23 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Nov 2006 01:47:11 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6C3117142FC for ; Wed, 8 Nov 2006 01:46:51 -0800 (PST) Message-ID: <12214335.1162979211440.JavaMail.jira@brutus> Date: Wed, 8 Nov 2006 01:46:51 -0800 (PST) From: "Vera Petrashkova (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-2103) [drlvm][jit] Jitrino/OPT does not reject class which uses incorrect invokespecial instruction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [drlvm][jit] Jitrino/OPT does not reject class which uses incorrect invokespecial instruction --------------------------------------------------------------------------------------------- Key: HARMONY-2103 URL: http://issues.apache.org/jira/browse/HARMONY-2103 Project: Harmony Issue Type: Bug Components: DRLVM Environment: Windows and Linux Reporter: Vera Petrashkova Jitrino/OPT does not reject some class which incorrect invokespecial instruction which uses method from an subclass of the current class. But according to J2SE VM specifications of invokespecial instruction the resolved method is selected for invocation unless all of the following conditions are true: - the ACC_SUPER flag is set for the current class - the class of the resolved method is a superclass of the current class - the resolved method is not an instance initialization method Interpreter and Jitrino/JET throws VerifyError in this case. To reproduce this issue run the following testInvokeSpecial which invokes classes testSupClass and testSubClass created from jasmin source code. --------------testInvokeSpecial.java------------- public class testInvokeSpecial { public static void main(String[] args) { try { System.out.println("Test failed: " + testSupClass.test()); } catch (VerifyError e ) { System.out.println("Test passes"); e.printStackTrace(); } catch (Throwable e ) { System.out.println("Test fails: unexpected error"); e.printStackTrace(); } } } --------------testSupClass.jj---------------- .class public testSupClass .super java/lang/Object ; ; standard initializer .method public ()V aload_0 invokespecial java/lang/Object/()V return .end method ; .method public static test()I .limit locals 3 .limit stack 3 new testSubClass dup invokespecial testSubClass/()V invokespecial testSubClass/mth()I ireturn .end method --------------------testSubClass.jj----------------- .class public testSubClass .super testSupClass ; ; standard initializer .method public ()V aload_0 invokespecial testSupClass/()V return .end method ; .method public mth()I .limit locals 2 .limit stack 2 sipush 105 ireturn .end method ---------------------------------------------- Create testSupClass and testSubClass classes using jasmin.jar or use classes from attachment java -jar jasmin.jar testSupClass.jj java -jar jasmin.jar testSubClass.jj Output on Harmony (Interpreter and Jitrino/JET) ===================== Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. java version "1.5.0" pre-alpha : not complete or compatible svn = r471468, (Nov 7 2006), Windows/ia32/msvc 1310, release build http://incubator.apache.org/harmony Test passes java.lang.VerifyError: (class: testSupClass, method: test()I) Incompatible object argument for invokespecial at testInvokeSpecial.main(testInvokeSpecial.java:4) Output on Harmony (Jitrino/OPT) ======================== Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. java version "1.5.0" pre-alpha : not complete or compatible svn = r471468, (Nov 7 2006), Linux/ia32/gcc 3.3.3, release build http://incubator.apache.org/harmony Test failed: 105 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira