Control-Flow: Generate instruction for left-hand side of invalid assignments

#KT-8390 Fixed
This commit is contained in:
Alexey Sedunov
2015-07-10 02:33:08 +03:00
parent d2dc44379e
commit df07a61a08
8 changed files with 43 additions and 39 deletions
@@ -9,12 +9,14 @@ L0:
magic[FAKE_INITIALIZER](c: C) -> <v0>
w(c|<v0>)
2 mark({ this = c })
r(c) -> <v1>
magic[UNSUPPORTED_ELEMENT](this = c|<v1>) -> <v2>
r(this, <this>) -> <v1>
magic[VALUE_CONSUMER](this|<v1>) -> <v2>
r(c) -> <v3>
w(this|<v3>)
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
<SINK> PREV:[<ERROR>, <END>]
=====================
+6 -3
View File
@@ -4,7 +4,10 @@ fun Int.bar(c: C) {
}
---------------------
<v0>: {<: [ERROR : C]} NEW: magic[FAKE_INITIALIZER](c: C) -> <v0>
c <v1>: * NEW: r(c) -> <v1>
this = c <v2>: * NEW: magic[UNSUPPORTED_ELEMENT](this = c|<v1>) -> <v2>
{ this = c } <v2>: * COPY
<v2>: * NEW: magic[VALUE_CONSUMER](this|<v1>) -> <v2>
this <v1>: * COPY
this <v1>: * NEW: r(this, <this>) -> <v1>
c <v3>: * NEW: r(c) -> <v3>
this = c !<v4>: *
{ this = c } !<v4>: * COPY
=====================
@@ -6,13 +6,15 @@ fun foo() {
L0:
1 <START>
2 mark({ x = "" })
magic[UNRESOLVED_CALL](x) -> <v0>
magic[VALUE_CONSUMER](x|<v0>) -> <v1>
mark("")
r("") -> <v0>
magic[UNSUPPORTED_ELEMENT](x = ""|<v0>) -> <v1>
r("") -> <v2>
w(x|<v2>)
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -3,7 +3,9 @@ fun foo() {
x = ""
}
---------------------
"" <v0>: * NEW: r("") -> <v0>
x = "" <v1>: * NEW: magic[UNSUPPORTED_ELEMENT](x = ""|<v0>) -> <v1>
{ x = "" } <v1>: * COPY
<v1>: * NEW: magic[VALUE_CONSUMER](x|<v0>) -> <v1>
x <v0>: * NEW: magic[UNRESOLVED_CALL](x) -> <v0>
"" <v2>: * NEW: r("") -> <v2>
x = "" !<v3>: *
{ x = "" } !<v3>: * COPY
=====================