kvn@741: /* trims@1907: * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. kvn@741: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. kvn@741: * kvn@741: * This code is free software; you can redistribute it and/or modify it kvn@741: * under the terms of the GNU General Public License version 2 only, as kvn@741: * published by the Free Software Foundation. kvn@741: * kvn@741: * This code is distributed in the hope that it will be useful, but WITHOUT kvn@741: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or kvn@741: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License kvn@741: * version 2 for more details (a copy is included in the LICENSE file that kvn@741: * accompanied this code). kvn@741: * kvn@741: * You should have received a copy of the GNU General Public License version kvn@741: * 2 along with this work; if not, write to the Free Software Foundation, kvn@741: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. kvn@741: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. kvn@741: */ kvn@741: kvn@741: /* kvn@741: * @test kvn@741: * @bug 6741738 kvn@741: * @summary TypePtr::add_offset() set incorrect offset when the add overflows kvn@741: * @run main/othervm -Xcomp -XX:CompileOnly=Tester.foo Tester kvn@741: */ kvn@741: kvn@741: public class Tester { kvn@741: private String[] values; kvn@741: private int count; kvn@741: kvn@741: String foo() { kvn@741: int i = Integer.MAX_VALUE-1; kvn@741: String s; kvn@741: try { kvn@741: s = values[i]; kvn@741: } catch (Throwable e) { kvn@741: s = ""; kvn@741: } kvn@741: return s; kvn@741: } kvn@741: kvn@741: public static void main(String[] args) { kvn@741: Tester t = new Tester(); kvn@741: String s = t.foo(); kvn@741: } kvn@741: }