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:
committed by
Mikhail Glukhikh
parent
43954699a7
commit
f8039249c6
+12
-11
@@ -11,7 +11,7 @@ fun test5() {
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
||||
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
||||
2 mark({ var a: Int try { a = 3 } finally { a = 5 } a.hashCode() })
|
||||
v(var a: Int) INIT: in: {} out: {a=D}
|
||||
mark(try { a = 3 } finally { a = 5 }) INIT: in: {a=D} out: {a=D}
|
||||
@@ -19,22 +19,23 @@ L0:
|
||||
3 mark({ a = 3 })
|
||||
r(3) -> <v0>
|
||||
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
|
||||
2 jmp(L3) INIT: in: {a=ID} out: {a=ID} USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
|
||||
2 jmp?(L2) INIT: in: {a=ID} out: {a=ID}
|
||||
jmp(L3) USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
|
||||
L2 [onExceptionToFinallyBlock]:
|
||||
L4 [start finally]:
|
||||
3 mark({ a = 5 }) INIT: in: {a=D} out: {a=D}
|
||||
r(5) -> <v2> USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ}
|
||||
w(a|<v2>) INIT: in: {a=D} out: {a=ID} USE: in: {} out: {a=ONLY_WRITTEN_NEVER_READ}
|
||||
3 mark({ a = 5 }) INIT: in: {a=I?D} out: {a=I?D}
|
||||
r(5) -> <v2> USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ}
|
||||
w(a|<v2>) INIT: in: {a=I?D} out: {a=ID} USE: in: {} out: {a=ONLY_WRITTEN_NEVER_READ}
|
||||
L5 [finish finally]:
|
||||
2 jmp(error) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
|
||||
2 jmp(error) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
|
||||
L3 [skipFinallyToErrorBlock]:
|
||||
L6 [copy of L2, onExceptionToFinallyBlock]:
|
||||
3 mark({ a = 5 })
|
||||
r(5) -> <v2> USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
|
||||
w(a|<v2>) USE: in: {a=READ} out: {a=WRITTEN_AFTER_READ}
|
||||
r(5) -> <v2> USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
|
||||
w(a|<v2>) USE: in: {a=READ} out: {a=WRITTEN_AFTER_READ}
|
||||
2 merge(try { a = 3 } finally { a = 5 }|!<v1>) -> <v4>
|
||||
mark(a.hashCode()) USE: in: {a=READ} out: {a=READ}
|
||||
r(a) -> <v5> USE: in: {} out: {a=READ}
|
||||
mark(a.hashCode()) USE: in: {a=READ} out: {a=READ}
|
||||
r(a) -> <v5> USE: in: {} out: {a=READ}
|
||||
mark(hashCode())
|
||||
call(hashCode(), hashCode|<v5>) -> <v6>
|
||||
L1:
|
||||
@@ -42,5 +43,5 @@ L1:
|
||||
error:
|
||||
<ERROR>
|
||||
sink:
|
||||
<SINK> USE: in: {} out: {}
|
||||
<SINK> USE: in: {} out: {}
|
||||
=====================
|
||||
|
||||
Reference in New Issue
Block a user