Files
kotlin-fork/compiler/testData/cfg/tailCalls/tryCatchFinally.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

54 lines
2.7 KiB
Plaintext
Vendored

== test ==
fun test() : Unit {
try {
test()
} catch (any : Exception) {
test()
} finally {
test()
}
}
---------------------
L0:
1 <START>
2 mark({ try { test() } catch (any : Exception) { test() } finally { test() } })
mark(try { test() } catch (any : Exception) { test() } finally { test() })
jmp?(L2) NEXT:[v(any : Exception), jmp?(L3)]
jmp?(L3) NEXT:[mark({ test() }), mark({ test() })]
3 mark({ test() })
mark(test())
call(test(), test) -> <v0>
2 jmp?(L2) NEXT:[v(any : Exception), jmp?(L3)]
jmp?(L3) NEXT:[mark({ test() }), jmp(L4)]
jmp(L4) NEXT:[jmp(L5)]
L2 [onException]:
3 v(any : Exception) PREV:[jmp?(L2), jmp?(L2)]
magic[FAKE_INITIALIZER](any : Exception) -> <v1>
w(any|<v1>)
4 mark({ test() })
mark(test())
call(test(), test) -> <v2>
3 jmp(L4)
L4 [afterCatches]:
2 jmp(L5) NEXT:[mark({ test() })] PREV:[jmp(L4), jmp(L4)]
L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
3 mark({ test() }) PREV:[jmp?(L3), jmp?(L3)]
mark(test())
call(test(), test) -> <v3>
L7 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L5 [skipFinallyToErrorBlock]:
L8 [copy of L3, onExceptionToFinallyBlock]:
3 mark({ test() }) PREV:[jmp(L5)]
mark(test())
call(test(), test) -> <v3>
2 merge(try { test() } catch (any : Exception) { test() } finally { test() }|<v0>, <v2>) -> <v4>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================