author | vromero |
Mon, 02 Jun 2014 22:36:40 +0100 | |
changeset 24793 | bb58a9f1ae10 |
parent 13105 | 68f3bf10f08e |
permissions | -rw-r--r-- |
13105
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
1 |
/* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
2 |
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
4 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
8 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
13 |
* accompanied this code). |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
14 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
18 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
21 |
* questions. |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
22 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
23 |
*/ |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
24 |
|
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
25 |
/** |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
26 |
* @test |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
27 |
* @bug 7174363 |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
28 |
* @summary crash with Arrays.copyOfRange(original, from, to) when from > original.length |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
29 |
* |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
30 |
* @run main/othervm -XX:-BackgroundCompilation Test7174363 |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
31 |
*/ |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
32 |
|
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
33 |
import java.util.*; |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
34 |
|
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
35 |
public class Test7174363 { |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
36 |
|
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
37 |
static Object[] m(Object[] original, int from, int to) { |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
38 |
return Arrays.copyOfRange(original, from, to, Object[].class); |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
39 |
} |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
40 |
|
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
41 |
static public void main(String[] args) { |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
42 |
Object[] orig = new Object[10]; |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
43 |
for (int i = 0; i < 20000; i++) { |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
44 |
try { |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
45 |
m(orig, 15, 20); |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
46 |
} catch(ArrayIndexOutOfBoundsException excp) {} |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
47 |
} |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
48 |
} |
68f3bf10f08e
7174363: Arrays.copyOfRange leads to VM crash with -Xcomp -server if executed by testing framework
roland
parents:
diff
changeset
|
49 |
} |