Partial fix for KT-14989: Missed null check for platform type
This commit is contained in:
@@ -660,13 +660,15 @@ public class AsmUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void putSelector(@NotNull Type type, @NotNull InstructionAdapter v) {
|
public void putSelector(@NotNull Type type, @NotNull InstructionAdapter v) {
|
||||||
stackValue.put(type, v);
|
Type innerType = stackValue.type;
|
||||||
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
|
stackValue.put(innerType, v);
|
||||||
|
if (innerType.getSort() == Type.OBJECT || innerType.getSort() == Type.ARRAY) {
|
||||||
v.dup();
|
v.dup();
|
||||||
v.visitLdcInsn(runtimeAssertionInfo.getMessage());
|
v.visitLdcInsn(runtimeAssertionInfo.getMessage());
|
||||||
v.invokestatic("kotlin/jvm/internal/Intrinsics", "checkExpressionValueIsNotNull",
|
v.invokestatic("kotlin/jvm/internal/Intrinsics", "checkExpressionValueIsNotNull",
|
||||||
"(Ljava/lang/Object;Ljava/lang/String;)V", false);
|
"(Ljava/lang/Object;Ljava/lang/String;)V", false);
|
||||||
}
|
}
|
||||||
|
StackValue.coerce(innerType, type, v);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//WITH_RUNTIME
|
||||||
|
// FILE: JavaClass.java
|
||||||
|
|
||||||
|
public class JavaClass {
|
||||||
|
|
||||||
|
public Double test() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: b.kt
|
||||||
|
|
||||||
|
fun test(s: Double) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
try {
|
||||||
|
test(JavaClass().test())
|
||||||
|
}
|
||||||
|
catch (e: IllegalStateException) {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
return "fail"
|
||||||
|
}
|
||||||
+6
@@ -368,6 +368,12 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAga
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt14989.kt")
|
||||||
|
public void testKt14989() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/platformTypes/kt14989.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("specializedMapFull.kt")
|
@TestMetadata("specializedMapFull.kt")
|
||||||
public void testSpecializedMapFull() throws Exception {
|
public void testSpecializedMapFull() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/platformTypes/specializedMapFull.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/platformTypes/specializedMapFull.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user