Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 90548 invoked from network); 2 Aug 2007 12:44:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 12:44:16 -0000 Received: (qmail 53013 invoked by uid 500); 2 Aug 2007 12:44:16 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 52992 invoked by uid 500); 2 Aug 2007 12:44:16 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 52983 invoked by uid 99); 2 Aug 2007 12:44:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 05:44:16 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Thu, 02 Aug 2007 12:43:54 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 479507141EB for ; Thu, 2 Aug 2007 05:43:53 -0700 (PDT) Message-ID: <668915.1186058633291.JavaMail.jira@brutus> Date: Thu, 2 Aug 2007 05:43:53 -0700 (PDT) From: "Mikhail Fursov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-1874) [drlvm][jit] Jitrino/OPT does not reject class which contains aastore instruction with incorrect argument on Linux EM-64T MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-1874?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Fursov resolved HARMONY-1874. ------------------------------------- Resolution: Fixed Committed as r 562098 > [drlvm][jit] Jitrino/OPT does not reject class which contains aastore ins= truction with incorrect argument on Linux EM-64T > -------------------------------------------------------------------------= ------------------------------------------------ > > Key: HARMONY-1874 > URL: https://issues.apache.org/jira/browse/HARMONY-1874 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Linux EM-64T > Reporter: Irina Arkhipets > Assignee: Mikhail Fursov > Attachments: cases.j, HARMONY-1874.patch, test.java > > > J2SE VM Specification reads about the aastore instruction: > ... > The type of value must be assignment compatible (=C2=A72.6.6) with the ty= pe of the components of the array referenced by arrayref. Assignment of a v= alue of reference type S (source) to a variable of reference type T (target= ) is allowed only when the type S supports all the operations defined on ty= pe T. The detailed rules follow: > - If S is a class type, then:=20 > * If T is a class type, then S must be the same class (=C2=A72.8.= 1) as T, or S must be a subclass of T;=20 > * If T is an interface type, S must implement (=C2=A72.13) interf= ace T.=20 > - If S is an array type, namely the type SC[], that is, an array of c= omponents of type SC, then:=20 > * If T is a class type, T must be Object (=C2=A72.4.6), or:=20 > ** If T is an array type, namely the type TC[], an array of c= omponents of type TC, then eitherTC and SC must be the same primitive type,= or=20 > ** TC and SC must both be reference types with type SC assign= able to TC, by these rules.=20 > S cannot be an interface type, because there are no instances of interfac= es, only instances of classes and arrays. > ... > However, VM does not reject class which contains incorrect aastore instr= uctions: > - when T is class but it is superclass of S > - when T is interface but S is not implemented T > - if S is interface and T is not Object class > - if T and S are different interfaces > This bug is reproducible on Linux EM-64T with jitrino OPT only. > It is not reproducible with interpreter and JET. > Please, compile the following sources and run the test class with "-Xem:o= pt" switch on Linux EM-64T server to reproduce this bug: > --------- test.java --------- > public class test { =20 > public static void main (String [] args) throws InterruptedException= { > /* T is class but it is superclass of S */ > try { > new cases().test1(); > System.out.println("Case 1: FAILED"); > } catch (ArrayStoreException e) { > System.out.println("Case 1: PASSED"); > } > /* T is interface but S is not implemented T */ > try { > new cases().test2(); > System.out.println("Case 2: FAILED"); > } catch (ArrayStoreException e) { > System.out.println("Case 2: PASSED"); > } > /* S is interface and T is not Object class */ > try { > new cases().test3(); > System.out.println("Case3: FAILED"); > } catch (ArrayStoreException e) { > System.out.println("Case 3: PASSED"); > } > /* if T and S are different interfaces */ > try { > new cases().test4(); > System.out.println("Case3: FAILED"); > } catch (ArrayStoreException e) { > System.out.println("Case 3: PASSED"); > } > } > } > class MyClass extends MySuperClass {} > class MySuperClass {} > interface MyInterface {} > interface MyInterface1 {} > class MyImplClass implements MyInterface {} > --------- cases.j --------- > .class public cases > .super java/lang/Object > .field public testField LMyInterface; > .method public ()V > aload_0 > invokespecial java/lang/Object/()V > return > .end method=20 > .method public test1()V > .limit locals 3 > .limit stack 4 > iconst_4 > anewarray MyClass > astore_1 > aload_1 > iconst_1 > new MySuperClass > dup > invokespecial MySuperClass/()V > aastore=20 > return > .end method > .method public test2()V > .limit locals 3 > .limit stack 4 > iconst_4 > anewarray MyInterface > astore_1=20 > aload_1 > iconst_1 > new MyClass > dup > invokespecial MyClass/()V > aastore=20 > return > .end method > .method public test3()V > .limit locals 3 > .limit stack 4 > iconst_4 > anewarray MyClass > astore_1=20 > aload_0 > new MyImplClass > dup > invokespecial MyImplClass/()V > putfield cases/testField LMyInterface; > aload_1 > iconst_1 > aload_0 > getfield cases/testField LMyInterface; > aastore ; must throw java/lang/ArrayStoreException > return > .end method > .method public test4()V > .limit locals 3 > .limit stack 4 > iconst_4 > anewarray MyInterface1 > astore_1 > aload_0 > new MyImplClass > dup > invokespecial MyImplClass/()V > putfield cases/testField LMyInterface; > aload_1 > iconst_1 > aload_0 > getfield cases/testField LMyInterface; > aastore=20 > return > .end method > ------------------------------ > Sample output is: > ... > Case 1: FAILED > Case 2: FAILED > Case3: FAILED > Case3: FAILED > ... --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.