Mon, 06 Nov 2017 16:51:47 +0800
[Code Reorganization] remove trailing whitespace to pass jcheck test
hseigel@7666 | 1 | /* |
hseigel@7666 | 2 | * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
hseigel@7666 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
hseigel@7666 | 4 | * |
hseigel@7666 | 5 | * This code is free software; you can redistribute it and/or modify it |
hseigel@7666 | 6 | * under the terms of the GNU General Public License version 2 only, as |
hseigel@7666 | 7 | * published by the Free Software Foundation. |
hseigel@7666 | 8 | * |
hseigel@7666 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
hseigel@7666 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
hseigel@7666 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
hseigel@7666 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
hseigel@7666 | 13 | * accompanied this code). |
hseigel@7666 | 14 | * |
hseigel@7666 | 15 | * You should have received a copy of the GNU General Public License version |
hseigel@7666 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
hseigel@7666 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
hseigel@7666 | 18 | * |
hseigel@7666 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
hseigel@7666 | 20 | * or visit www.oracle.com if you need additional information or have any |
hseigel@7666 | 21 | * questions. |
hseigel@7666 | 22 | * |
hseigel@7666 | 23 | */ |
hseigel@7666 | 24 | |
hseigel@7666 | 25 | /* |
hseigel@7666 | 26 | * This class should throw VerifyError because the StackMap for bytecode index |
hseigel@7666 | 27 | * 9 (istore_2, line 60) is incorrect. The stack maps for bytecode indexes 9 |
hseigel@7666 | 28 | * and 18 (astore_2, line 70) do not match because 9 does not supply enough |
hseigel@7666 | 29 | * locals to satisfy 18. |
hseigel@7666 | 30 | * |
hseigel@7666 | 31 | * The istore_2 bytecode at bytecode index 9 changes the type state, |
hseigel@7666 | 32 | * preventing the stackmap mismatch. But, if the incoming type state is used, |
hseigel@7666 | 33 | * as required by JVM Spec 8, then the verifier will detected the stackmap |
hseigel@7666 | 34 | * mismatch, and throw VerifyError. |
hseigel@7666 | 35 | */ |
hseigel@7666 | 36 | |
hseigel@7666 | 37 | super public class BadMapIstore |
hseigel@7666 | 38 | version 51:0 |
hseigel@7666 | 39 | { |
hseigel@7666 | 40 | |
hseigel@7666 | 41 | Field blah:I; |
hseigel@7666 | 42 | |
hseigel@7666 | 43 | public Method "<init>":"()V" |
hseigel@7666 | 44 | stack 1 locals 1 |
hseigel@7666 | 45 | { |
hseigel@7666 | 46 | aload_0; |
hseigel@7666 | 47 | invokespecial Method java/lang/Object."<init>":"()V"; |
hseigel@7666 | 48 | return; |
hseigel@7666 | 49 | } |
hseigel@7666 | 50 | |
hseigel@7666 | 51 | public static Method main:"([Ljava/lang/String;)V" |
hseigel@7666 | 52 | stack 2 locals 3 |
hseigel@7666 | 53 | { |
hseigel@7666 | 54 | new class BadMapIstore; |
hseigel@7666 | 55 | dup; |
hseigel@7666 | 56 | invokespecial Method "<init>":"()V"; |
hseigel@7666 | 57 | astore_1; |
hseigel@7666 | 58 | iconst_2; |
hseigel@7666 | 59 | try t0; |
hseigel@7666 | 60 | istore_2; |
hseigel@7666 | 61 | aload_1; |
hseigel@7666 | 62 | iconst_5; |
hseigel@7666 | 63 | putfield Field blah:"I"; |
hseigel@7666 | 64 | endtry t0; |
hseigel@7666 | 65 | goto L22; |
hseigel@7666 | 66 | catch t0 java/lang/Throwable; |
hseigel@7666 | 67 | stack_frame_type full; |
hseigel@7666 | 68 | locals_map class "[Ljava/lang/String;", class BadMapIstore, int; |
hseigel@7666 | 69 | stack_map class java/lang/Throwable; |
hseigel@7666 | 70 | astore_2; |
hseigel@7666 | 71 | aload_1; |
hseigel@7666 | 72 | iconst_4; |
hseigel@7666 | 73 | istore_2; |
hseigel@7666 | 74 | pop; |
hseigel@7666 | 75 | L22: stack_frame_type same; |
hseigel@7666 | 76 | return; |
hseigel@7666 | 77 | } |
hseigel@7666 | 78 | |
hseigel@7666 | 79 | } // end Class BadMapIstore |