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)
This commit is contained in:
Mikhail Glukhikh
2016-04-20 17:34:19 +03:00
committed by Mikhail Glukhikh
parent 43954699a7
commit f8039249c6
28 changed files with 638 additions and 89 deletions
+5 -3
View File
@@ -13,12 +13,14 @@ L0:
mark(try { return foo() } catch (e: Throwable) { })
jmp?(L2) NEXT:[v(e: Throwable), mark({ return foo() })]
3 mark({ return foo() })
jmp?(L2) NEXT:[v(e: Throwable), mark(foo())]
mark(foo())
call(foo(), foo) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
- 2 jmp(L3) NEXT:[merge(try { return foo() } catch (e: Throwable) { }|!<v1>, !<v3>) -> <v4>] PREV:[]
- 2 jmp?(L2) NEXT:[v(e: Throwable), jmp(L3)] PREV:[]
- jmp(L3) NEXT:[merge(try { return foo() } catch (e: Throwable) { }|!<v1>, !<v3>) -> <v4>] PREV:[]
L2 [onException]:
3 v(e: Throwable) PREV:[jmp?(L2)]
3 v(e: Throwable) PREV:[jmp?(L2), jmp?(L2)]
magic[FAKE_INITIALIZER](e: Throwable) -> <v2>
w(e|<v2>)
4 mark({ })
@@ -32,4 +34,4 @@ error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================