mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8327839: Crash with unboxing and widening primitive conversion in switch
Reviewed-by: jlahoda
This commit is contained in:
parent
86f1744736
commit
fb390d202c
5 changed files with 111 additions and 12 deletions
|
@ -468,22 +468,23 @@ public class SwitchBootstraps {
|
|||
Label notNumber = cb.newLabel();
|
||||
cb.aload(SELECTOR_OBJ);
|
||||
cb.instanceof_(ConstantDescs.CD_Number);
|
||||
if (selectorType == long.class || selectorType == float.class || selectorType == double.class) {
|
||||
if (selectorType == long.class || selectorType == float.class || selectorType == double.class ||
|
||||
selectorType == Long.class || selectorType == Float.class || selectorType == Double.class) {
|
||||
cb.ifeq(next);
|
||||
} else {
|
||||
cb.ifeq(notNumber);
|
||||
}
|
||||
cb.aload(SELECTOR_OBJ);
|
||||
cb.checkcast(ConstantDescs.CD_Number);
|
||||
if (selectorType == long.class) {
|
||||
if (selectorType == long.class || selectorType == Long.class) {
|
||||
cb.invokevirtual(ConstantDescs.CD_Number,
|
||||
"longValue",
|
||||
MethodTypeDesc.of(ConstantDescs.CD_long));
|
||||
} else if (selectorType == float.class) {
|
||||
} else if (selectorType == float.class || selectorType == Float.class) {
|
||||
cb.invokevirtual(ConstantDescs.CD_Number,
|
||||
"floatValue",
|
||||
MethodTypeDesc.of(ConstantDescs.CD_float));
|
||||
} else if (selectorType == double.class) {
|
||||
} else if (selectorType == double.class || selectorType == Double.class) {
|
||||
cb.invokevirtual(ConstantDescs.CD_Number,
|
||||
"doubleValue",
|
||||
MethodTypeDesc.of(ConstantDescs.CD_double));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue