JVM_IR: sidestep defective getMethodAsmFlags when inlining lambdas
It uses isStaticMethod to determine whether to set ACC_STATIC, which is not correct (see PR #2341). This results in using incorrectly typed opcodes (as all arguments are shifted by 1) when modifying the inlined lambda's bytecode. For example, in the test added by this commit, these opcodes are inserted to spill the stack into locals before calling another inline function. Because getMethodAsmFlags is used by the non-IR backend (see PR #2341 again for why changing stuff might not be a good idea), the proposed solution is to ditch it completely and override generateLambdaBody in IrExpressionLambdaImpl to use FunctionCodegen's IR-based flag computation logic.
This commit is contained in:
+5
@@ -2914,6 +2914,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||
public void testInlineCallInInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/simple/inlineCallInInlineLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt17431.kt")
|
||||
public void testKt17431() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/simple/kt17431.kt");
|
||||
|
||||
Reference in New Issue
Block a user