Pseudocode: Generate instructions for unresolved array assignments

This commit is contained in:
Alexey Sedunov
2014-10-06 16:35:16 +04:00
parent b06b3ab4c4
commit a56c54371e
12 changed files with 220 additions and 5 deletions
@@ -0,0 +1,37 @@
== A ==
class A
---------------------
L0:
1 <START>
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== foo ==
fun foo(a: A) {
a[1] = 2
}
---------------------
L0:
1 <START>
v(a: A)
magic[FAKE_INITIALIZER](a: A) -> <v0>
w(a|<v0>)
2 mark({ a[1] = 2 })
mark(a[1])
error(a[1], No resolved call)
r(a) -> <v1>
r(1) -> <v2>
magic[UNRESOLVED_CALL](a[1]|<v1>, <v2>) -> <v3>
r(2) -> <v4>
magic[UNRESOLVED_CALL](a[1] = 2|<v3>, <v4>) -> <v5>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================