[JVM_IR] Fix off-by-one line number error in CoroutineCodegen.
Fixes KT-41957.
This commit is contained in:
committed by
Alexander Udalov
parent
13def12731
commit
17748b4499
+2
-2
@@ -55,12 +55,12 @@ internal fun MethodNode.acceptWithStateMachine(
|
|||||||
val irFile = irFunction.file
|
val irFile = irFunction.file
|
||||||
if (irFunction.startOffset >= 0) {
|
if (irFunction.startOffset >= 0) {
|
||||||
// if it suspend function like `suspend fun foo(...)`
|
// if it suspend function like `suspend fun foo(...)`
|
||||||
irFile.fileEntry.getLineNumber(irFunction.startOffset)
|
irFile.fileEntry.getLineNumber(irFunction.startOffset) + 1
|
||||||
} else {
|
} else {
|
||||||
val klass = classCodegen.irClass
|
val klass = classCodegen.irClass
|
||||||
if (klass.startOffset >= 0) {
|
if (klass.startOffset >= 0) {
|
||||||
// if it suspend lambda transformed into class `runSuspend { .... }`
|
// if it suspend lambda transformed into class `runSuspend { .... }`
|
||||||
irFile.fileEntry.getLineNumber(klass.startOffset)
|
irFile.fileEntry.getLineNumber(klass.startOffset) + 1
|
||||||
} else 0
|
} else 0
|
||||||
}
|
}
|
||||||
} else element?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0
|
} else element?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
LineBreakpoint created at stepIntoSuspendFunctionSimple.kt:20
|
LineBreakpoint created at stepIntoSuspendFunctionSimple.kt:20
|
||||||
Run Java
|
Run Java
|
||||||
Connected to the target VM
|
Connected to the target VM
|
||||||
|
|||||||
Reference in New Issue
Block a user