Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 99357 invoked from network); 28 Nov 2006 15:29:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 15:29:58 -0000 Received: (qmail 93155 invoked by uid 500); 28 Nov 2006 15:30:02 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 93123 invoked by uid 500); 28 Nov 2006 15:30:02 -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 93102 invoked by uid 99); 28 Nov 2006 15:30:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 07:30:02 -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; Tue, 28 Nov 2006 07:29:52 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 126F071430E for ; Tue, 28 Nov 2006 07:29:32 -0800 (PST) Message-ID: <9529955.1164727772073.JavaMail.jira@brutus> Date: Tue, 28 Nov 2006 07:29:32 -0800 (PST) From: "Gregory Shimansky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2191) [drlvm][jit][opt] It is possible to call an array element of multidimensional array with first 0-dimention MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2191?page=all ] Gregory Shimansky updated HARMONY-2191: --------------------------------------- Summary: [drlvm][jit][opt] It is possible to call an array element of multidimensional array with first 0-dimention (was: [drlvm] [jit] [opt] It is possible to call an array element of multidimensional array with first 0-dimention) > [drlvm][jit][opt] It is possible to call an array element of multidimensional array with first 0-dimention > ---------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2191 > URL: http://issues.apache.org/jira/browse/HARMONY-2191 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Any > Reporter: Elena Sayapina > Attachments: MultiArr.java > > > ArrayIndexOutOfBoundsException isn't thrown in some cases if call an array element of multidimensional array with first 0-dimention (for example, int > arr[] = int[0][1]). It only happens in JIT server static mode, so suppose ABCD optimization incorrectly remove up bound check. > Please, see the code example below. > Code for reproducing: > public class MultiArr { > public static void main(String[] args) { > System.exit(new MultiArr().test()); > } > > public int test() { > System.out.println("Start MultiArr test..."); > try { > check(new int[0][0], 2); > System.out.println("TEST FAILED: ArrayIndexOutOfBoundsException wasn't thrown"); > return 1; > } catch (ArrayIndexOutOfBoundsException e) { > System.out.println("TEST PASSED: ArrayIndexOutOfBoundsException was thown"); > return 0; > } > } > > void check(int[][] array, int num) { > boolean error = false; > for (int i = num-1; i >= 0; i--) { > if (error) return; > if (i < num-1) { > System.out.println("Call array[" + i + "][" + (i+1) + "]"); > error = true; > array[i][i+1] = 0; > } > } > } > } > NOTE: it is no matter write to an element array[0][1] or read the value of array[0][1] to some variable (for example, int var = array[0][1]). > Steps to Reproduce: > Compile and run MultiArr class on Harmony with '-Xem:server_static option'. > Output on Windows: > 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 = r@svn.revision@, (Nov 14 2006), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Start MultiArr test... > Call array[0][1] > TEST FAILED: ArrayIndexOutOfBoundsException wasn't thrown > Output on Linux: > 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 = r@svn.revision@, (Nov 14 2006), Linux/ia32/gcc 3.3.3, release build > http://incubator.apache.org/harmony > Start MultiArr test... > Call array[0][1] > TEST FAILED: ArrayIndexOutOfBoundsException wasn't thrown > Output on RI: > Start MultiArr test... > Call array[0][1] > TEST PASSED: ArrayIndexOutOfBoundsException was thown > Note: Test passes in JIT default mode -- 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