2
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
26
* This class should throw VerifyError because the StackMap for bytecode index
27
* 45 (astore_2, line 123) is incorrect. The stack maps for bytecode indexes 45
28
* and 49 (astore, line 133) do not match because 45 does not supply enough
29
* locals to satisfy 49.
31
* The astore_2 bytecode at bytecode index 45 changes the type state,
32
* preventing the stackmap mismatch. But, if the incoming type state is used,
33
* as required by JVM Spec 8, then the verifier will detected the stackmap
34
* mismatch, and throw VerifyError.
37
super public class BadMap
42
public Method "<init>":"()V"
46
invokespecial Method java/lang/Object."<init>":"()V";
50
public static Method main:"([Ljava/lang/String;)V"
51
throws java/lang/Throwable
57
public static Method foo:"()V"
64
L5: stack_frame_type full;
74
catch t0 java/io/IOException;
75
stack_frame_type full;
76
locals_map class java/lang/Object, null;
77
stack_map class java/io/IOException;
84
L19: stack_frame_type full;
85
locals_map class java/lang/Object, class java/lang/Object;
96
stack_frame_type full;
97
locals_map class java/lang/Object, class java/lang/Object;
98
stack_map class java/lang/Throwable;
104
L35: stack_frame_type full;
105
locals_map class java/lang/Object, class java/lang/Object, bogus, class java/lang/Throwable;
109
L37: stack_frame_type full;
110
locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
115
L42: stack_frame_type full;
116
locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
118
catch t3 java/lang/Exception;
120
stack_frame_type full;
121
locals_map class java/lang/Object, class java/lang/Object;
122
stack_map class java/lang/Exception;
123
astore_2; // astore_2, at bci 45, that changes the type state.
130
stack_frame_type full;
131
locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
132
stack_map class java/lang/Throwable;
137
L54: stack_frame_type full;
138
locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
140
L57: stack_frame_type full;
141
locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
146
stack_frame_type full;
147
stack_map class java/lang/Throwable;