Wed, 21 May 2014 10:56:41 -0700
Added tag jdk8u20-b15 for changeset 8c785f9bde6f
kvn@1000 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
kvn@1000 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
kvn@1000 | 4 | * |
kvn@1000 | 5 | * This code is free software; you can redistribute it and/or modify it |
kvn@1000 | 6 | * under the terms of the GNU General Public License version 2 only, as |
kvn@1000 | 7 | * published by the Free Software Foundation. |
kvn@1000 | 8 | * |
kvn@1000 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
kvn@1000 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
kvn@1000 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
kvn@1000 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
kvn@1000 | 13 | * accompanied this code). |
kvn@1000 | 14 | * |
kvn@1000 | 15 | * You should have received a copy of the GNU General Public License version |
kvn@1000 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
kvn@1000 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
kvn@1000 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
kvn@1000 | 22 | * |
kvn@1000 | 23 | */ |
kvn@1000 | 24 | |
kvn@1000 | 25 | /* |
kvn@1000 | 26 | * @test |
kvn@1000 | 27 | * @bug 6799693 |
kvn@1000 | 28 | * @summary Server compiler leads to data corruption when expression throws an Exception |
kvn@1000 | 29 | * @run main/othervm -Xcomp -XX:CompileOnly=Test Test |
kvn@1000 | 30 | */ |
kvn@1000 | 31 | |
kvn@1000 | 32 | public class Test { |
kvn@1000 | 33 | static int var_bad = 1; |
kvn@1000 | 34 | |
kvn@1000 | 35 | public static void main(String[] args) |
kvn@1000 | 36 | { |
kvn@1000 | 37 | var_bad++; |
kvn@1000 | 38 | |
kvn@1000 | 39 | try { |
kvn@1000 | 40 | for (int i = 0; i < 10; i++) (new byte[((byte)-1 << i)])[0] = 0; |
kvn@1000 | 41 | } |
kvn@1000 | 42 | catch (Exception e) { System.out.println("Got " + e); } |
kvn@1000 | 43 | |
kvn@1000 | 44 | System.out.println("Test.var_bad = " + var_bad + " (expected 2)\n"); |
kvn@1000 | 45 | } |
kvn@1000 | 46 | } |
kvn@1000 | 47 |