Inline: Fix operand stack type verify error
This is a proposal to fix KT-49364. Operand stack type verification happens before `checkcast` is executed. When we implicitly cast an inline class to a non-inline type, if type of stack value is not subtype of the target, then coercing is necessary.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
val a:ULong = 1u
|
||||
a as Int
|
||||
func(a)
|
||||
} catch (e: ClassCastException) {
|
||||
return "OK"
|
||||
}
|
||||
return "FAIL"
|
||||
}
|
||||
|
||||
fun func(para: Int) {}
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// 1 CHECKCAST java/lang/Integer
|
||||
// 1 L2I
|
||||
Reference in New Issue
Block a user