[Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
This commit is contained in:
+6
@@ -4606,6 +4606,12 @@ public class FirLightTreeBytecodeTextTestGenerated extends AbstractFirLightTreeB
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt61768.kt")
|
||||
public void testKt61768() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/kt61768.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleThen.kt")
|
||||
public void testSingleThen() throws Exception {
|
||||
|
||||
+6
@@ -4606,6 +4606,12 @@ public class FirPsiBytecodeTextTestGenerated extends AbstractFirPsiBytecodeTextT
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt61768.kt")
|
||||
public void testKt61768() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/kt61768.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleThen.kt")
|
||||
public void testSingleThen() throws Exception {
|
||||
|
||||
+4
-1
@@ -582,7 +582,10 @@ class ExpressionCodegen(
|
||||
|
||||
override fun visitCall(expression: IrCall, data: BlockInfo): PromisedValue {
|
||||
val intrinsic = classCodegen.context.getIntrinsic(expression.symbol) as IntrinsicMethod?
|
||||
intrinsic?.invoke(expression, this, data)?.let { return it }
|
||||
if (intrinsic != null) {
|
||||
expression.markLineNumber(true)
|
||||
intrinsic.invoke(expression, this, data)?.let { return it }
|
||||
}
|
||||
|
||||
val callee = expression.symbol.owner
|
||||
require(callee.parent is IrClass) { "Unhandled intrinsic in ExpressionCodegen: ${callee.render()}" }
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
fun increment() {
|
||||
var i = 10
|
||||
i = i + 10
|
||||
}
|
||||
|
||||
// 1 LINENUMBER 5 L1\n +IINC
|
||||
+6
@@ -4606,6 +4606,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt61768.kt")
|
||||
public void testKt61768() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/lineNumbers/kt61768.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleThen.kt")
|
||||
public void testSingleThen() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user