Pseudocode: Replace UnsupportedElementInstruction with UNSUPPORTED_ELEMENT magic.

Generate UNSUPPORTED_ELEMENT for assignments with unresolved left-han side
This commit is contained in:
Alexey Sedunov
2014-07-21 13:45:12 +04:00
parent c32d112e67
commit e11ffb8542
20 changed files with 80 additions and 102 deletions
@@ -21,7 +21,6 @@ L0:
v(b: Int)
magic[FAKE_INITIALIZER](b: Int) -> <v1>
w(b|<v1>)
unsupported(DELEGATOR_SUPER_CLASS : T)
L1:
<END> NEXT:[<SINK>]
error:
@@ -31,13 +31,12 @@ class B : A {
---------------------
L0:
1 <START>
unsupported(DELEGATOR_SUPER_CLASS : A)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
<SINK> PREV:[<ERROR>, <END>]
=====================
== foo ==
override fun foo() = 10
@@ -10,11 +10,11 @@ L0:
w(c|<v0>)
2 mark({ this = c })
r(c) -> <v1>
unsupported(BINARY_EXPRESSION : this = c)
magic[UNSUPPORTED_ELEMENT](this = c|<v1>) -> <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,6 +3,8 @@ fun Int.bar(c: C) {
this = c
}
---------------------
<v0>: {<: [ERROR : C]} NEW: magic[FAKE_INITIALIZER](c: C) -> <v0>
c <v1>: * NEW: r(c) -> <v1>
<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
=====================
@@ -11,11 +11,11 @@ L0:
2 mark({ s. })
mark(s.)
r(s) -> <v1>
magic[UNSUPPORTED_OPERATION](s.|<v1>) -> <v2>
magic[UNSUPPORTED_ELEMENT](s.|<v1>) -> <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,8 +3,8 @@ fun foo(s: String) {
s.
}
---------------------
<v0>: String NEW: magic[FAKE_INITIALIZER](s: String) -> <v0>
s <v1>: * NEW: r(s) -> <v1>
s. <v2>: * NEW: magic[UNSUPPORTED_OPERATION](s.|<v1>) -> <v2>
{ s. } <v2>: * COPY
<v0>: String NEW: magic[FAKE_INITIALIZER](s: String) -> <v0>
s <v1>: * NEW: r(s) -> <v1>
s. <v2>: * NEW: magic[UNSUPPORTED_ELEMENT](s.|<v1>) -> <v2>
{ s. } <v2>: * COPY
=====================
@@ -0,0 +1,18 @@
== foo ==
fun foo() {
x = ""
}
---------------------
L0:
1 <START>
2 mark({ x = "" })
mark("")
r("") -> <v0>
magic[UNSUPPORTED_ELEMENT](x = ""|<v0>) -> <v1>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,3 @@
fun foo() {
x = ""
}
@@ -0,0 +1,9 @@
== foo ==
fun foo() {
x = ""
}
---------------------
"" <v0>: * NEW: r("") -> <v0>
x = "" <v1>: * NEW: magic[UNSUPPORTED_ELEMENT](x = ""|<v0>) -> <v1>
{ x = "" } <v1>: * COPY
=====================