mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Loosen tail call check
Check that any source of ARETURN is inside a suspension point, not all of them. #KT-27190 Fixed
This commit is contained in:
17
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.kt
vendored
Normal file
17
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// WITH_RUNTIME
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
fun check() = true
|
||||
|
||||
suspend fun f(i: Int): Unit {
|
||||
return f_2()
|
||||
}
|
||||
|
||||
private inline suspend fun f_2(): Unit {
|
||||
if (check()) return
|
||||
return suspendCoroutineUninterceptedOrReturn {
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
6
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.txt
vendored
Normal file
6
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
@kotlin.Metadata
|
||||
public final class TailCallIfReturnUnitKt {
|
||||
public final static method check(): boolean
|
||||
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
private synthetic final static method f_2(p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
}
|
||||
6
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit_1_3.txt
vendored
Normal file
6
compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit_1_3.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
@kotlin.Metadata
|
||||
public final class TailCallIfReturnUnitKt {
|
||||
public final static method check(): boolean
|
||||
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
private synthetic final static method f_2(p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
Reference in New Issue
Block a user