Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8270047 | 18 | Jan Lahoda | P3 | Resolved | Fixed | b06 |
JDK-8270723 | 17.0.1 | Jan Lahoda | P3 | Resolved | Fixed | b03 |
Following class compiled with --enable-preview:
---
public class T {
static void m(java.util.function.Consumer<Object> cons) {}
public static void main(String[] args) {
m(o -> {
if (o instanceof CharSequence chs) {
switch (chs) {
default -> {}
}
}
});
}
}
---
Fails to initialize due to invalid stack map:
---
Error: Unable to initialize main class T
Caused by: java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
T.lambda$main$0(Ljava/lang/Object;)V @12: aload_2
Reason:
Type top (current frame, locals[2]) is not assignable to reference type
Current Frame:
bci: @12
flags: { }
locals: { 'java/lang/Object', 'java/lang/CharSequence' }
stack: { }
Bytecode:
0000000: 2ac1 0011 9900 242a c000 114c 2c59 b800
0000010: 1357 4d03 3e2c 1dba 0019 0000 ab00 0000
0000020: 0000 000c 0000 0000 b1
Stackmap Table:
append_frame(@21,Object[#17],Object[#17],Integer)
chop_frame(@40,3)
---
public class T {
static void m(java.util.function.Consumer<Object> cons) {}
public static void main(String[] args) {
m(o -> {
if (o instanceof CharSequence chs) {
switch (chs) {
default -> {}
}
}
});
}
}
---
Fails to initialize due to invalid stack map:
---
Error: Unable to initialize main class T
Caused by: java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
T.lambda$main$0(Ljava/lang/Object;)V @12: aload_2
Reason:
Type top (current frame, locals[2]) is not assignable to reference type
Current Frame:
bci: @12
flags: { }
locals: { 'java/lang/Object', 'java/lang/CharSequence' }
stack: { }
Bytecode:
0000000: 2ac1 0011 9900 242a c000 114c 2c59 b800
0000010: 1357 4d03 3e2c 1dba 0019 0000 ab00 0000
0000020: 0000 000c 0000 0000 b1
Stackmap Table:
append_frame(@21,Object[#17],Object[#17],Integer)
chop_frame(@40,3)
- backported by
-
JDK-8270047 javac generates class with invalid stack map
-
- Resolved
-
-
JDK-8270723 javac generates class with invalid stack map
-
- Resolved
-