Fix CCE when unboxed inline class receiver is passed to inline function
Initial problem is started in `capturedBoundReferenceReceiver` method where we assume that bound receiver is captured for usual call. Note that if method is inline then we don't pass actual name reference receiver, but pass special CAPTURED_RECEIVER_FIELD, which is then is used to find special instructions during inline and fold several instructions in `foldFieldAccessChainIfNeeded`. As a result, we got unboxed reference receiver for inline call, which caused CCE and to fix it we should box receiver one more time during inline #KT-28188 Fixed
This commit is contained in:
+5
@@ -11665,6 +11665,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt")
|
||||
public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");
|
||||
|
||||
Reference in New Issue
Block a user