More accurate CFG for local class constructors (now they are not considered unconditionally executed) #KT-10042 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-03-21 17:35:53 +03:00
parent 8756cba2f5
commit b975b7d26e
15 changed files with 155 additions and 36 deletions
@@ -17,13 +17,15 @@ L0:
2 mark({ "before" object A { init { val a = 1 } fun foo() { val b = 2 } } "after" })
mark("before")
r("before") -> <v0>
jmp?(L2)
3 mark({ val a = 1 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) -> <v1> INIT: in: {a=D} out: {a=D}
w(a|<v1>) INIT: in: {a=D} out: {a=ID}
2 jmp?(L2) INIT: in: {} out: {}
2 jmp?(L3) INIT: in: {} out: {}
d(fun foo() { val b = 2 })
L2 [after local declaration]:
L2 [after local class]:
L3 [after local declaration]:
mark("after")
r("after") -> <v2>
L1:
@@ -38,13 +40,13 @@ fun foo() {
val b = 2
}
---------------------
L3:
L4:
3 <START> INIT: in: {} out: {}
4 mark({ val b = 2 })
v(val b = 2) INIT: in: {} out: {b=D}
r(2) -> <v0> INIT: in: {b=D} out: {b=D}
w(b|<v0>) INIT: in: {b=D} out: {b=ID}
L4:
L5:
3 <END> INIT: in: {} out: {}
error:
<ERROR>