Files
kotlin-fork/compiler/testData/cfg/tailCalls/finally.instructions
T
Mikhail Glukhikh f8039249c6 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00

39 lines
1.4 KiB
Plaintext
Vendored

== test ==
tailrec fun test() : Int {
try {
// do nothing
} finally {
test()
}
}
---------------------
L0:
1 <START>
2 mark({ try { // do nothing } finally { test() } })
mark(try { // do nothing } finally { test() })
jmp?(L2) NEXT:[mark({ test() }), mark({ // do nothing })]
3 mark({ // do nothing })
read (Unit)
2 jmp?(L2) NEXT:[mark({ test() }), jmp(L3)]
jmp(L3) NEXT:[mark({ test() })]
L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
3 mark({ test() }) PREV:[jmp?(L2), jmp?(L2)]
mark(test())
call(test(), test) -> <v0>
L5 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L3 [skipFinallyToErrorBlock]:
L6 [copy of L2, onExceptionToFinallyBlock]:
3 mark({ test() }) PREV:[jmp(L3)]
mark(test())
call(test(), test) -> <v0>
2 merge(try { // do nothing } finally { test() }|!<v1>) -> <v2>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================