hseigel@7666: /* hseigel@7666: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. hseigel@7666: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hseigel@7666: * hseigel@7666: * This code is free software; you can redistribute it and/or modify it hseigel@7666: * under the terms of the GNU General Public License version 2 only, as hseigel@7666: * published by the Free Software Foundation. hseigel@7666: * hseigel@7666: * This code is distributed in the hope that it will be useful, but WITHOUT hseigel@7666: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hseigel@7666: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hseigel@7666: * version 2 for more details (a copy is included in the LICENSE file that hseigel@7666: * accompanied this code). hseigel@7666: * hseigel@7666: * You should have received a copy of the GNU General Public License version hseigel@7666: * 2 along with this work; if not, write to the Free Software Foundation, hseigel@7666: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hseigel@7666: * hseigel@7666: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hseigel@7666: * or visit www.oracle.com if you need additional information or have any hseigel@7666: * questions. hseigel@7666: * hseigel@7666: */ hseigel@7666: hseigel@7666: /* hseigel@7666: * This class should throw VerifyError because the StackMap for bytecode index hseigel@7666: * 9 (dstore_2, line 60) is incorrect. The stack maps for bytecode indexes 9 hseigel@7666: * and 18 (astore_2, line 70) do not match because 9 does not supply enough hseigel@7666: * locals to satisfy 18. hseigel@7666: * hseigel@7666: * The dstore_2 bytecode at bytecode index 9 changes the type state, hseigel@7666: * preventing the stackmap mismatch. But, if the incoming type state is used, hseigel@7666: * as required by JVM Spec 8, then the verifier will detected the stackmap hseigel@7666: * mismatch, and throw VerifyError. hseigel@7666: */ hseigel@7666: hseigel@7666: super public class BadMapDstore hseigel@7666: version 51:0 hseigel@7666: { hseigel@7666: hseigel@7666: Field blah:I; hseigel@7666: hseigel@7666: public Method "":"()V" hseigel@7666: stack 1 locals 1 hseigel@7666: { hseigel@7666: aload_0; hseigel@7666: invokespecial Method java/lang/Object."":"()V"; hseigel@7666: return; hseigel@7666: } hseigel@7666: hseigel@7666: public static Method main:"([Ljava/lang/String;)V" hseigel@7666: stack 4 locals 4 hseigel@7666: { hseigel@7666: new class BadMapDstore; hseigel@7666: dup; hseigel@7666: invokespecial Method "":"()V"; hseigel@7666: astore_1; hseigel@7666: dconst_1; hseigel@7666: try t0; hseigel@7666: dstore_2; hseigel@7666: aload_1; hseigel@7666: iconst_5; hseigel@7666: putfield Field blah:"I"; hseigel@7666: endtry t0; hseigel@7666: goto L22; hseigel@7666: catch t0 java/lang/Throwable; hseigel@7666: stack_frame_type full; hseigel@7666: locals_map class "[Ljava/lang/String;", class BadMapDstore, double; hseigel@7666: stack_map class java/lang/Throwable; hseigel@7666: astore_2; hseigel@7666: aload_1; hseigel@7666: dconst_0; hseigel@7666: dstore_2; hseigel@7666: pop; hseigel@7666: L22: stack_frame_type same; hseigel@7666: return; hseigel@7666: } hseigel@7666: hseigel@7666: } // end Class BadMapDstore