Proper order of arguments in array setter calls

This commit is contained in:
Andrey Breslav
2013-12-03 17:59:47 +04:00
parent 163e5cfbb4
commit a5854560f0
5 changed files with 67 additions and 33 deletions
+22 -22
View File
@@ -11,29 +11,29 @@ fun foo() {
---------------------
L0:
<START> NEXT:[v(val a = Array<Int>)] PREV:[]
v(val a = Array<Int>) NEXT:[r(Array)] PREV:[<START>]
r(Array) NEXT:[r(Array<Int>)] PREV:[v(val a = Array<Int>)]
r(Array<Int>) NEXT:[w(a)] PREV:[r(Array)]
w(a) NEXT:[r(3)] PREV:[r(Array<Int>)]
r(3) NEXT:[r(4)] PREV:[w(a)]
r(4) NEXT:[r(10)] PREV:[r(3)]
r(10) NEXT:[r(a)] PREV:[r(4)]
r(a) NEXT:[r(=)] PREV:[r(10)]
r(=) NEXT:[w(a[10])] PREV:[r(a)]
w(a[10]) NEXT:[r(2)] PREV:[r(=)]
r(2) NEXT:[r(10)] PREV:[w(a[10])]
r(10) NEXT:[r(a)] PREV:[r(2)]
r(a) NEXT:[r(a[10])] PREV:[r(10)]
r(a[10]) NEXT:[r(100)] PREV:[r(a)]
r(100) NEXT:[r(10)] PREV:[r(a[10])]
r(10) NEXT:[r(a)] PREV:[r(100)]
r(a) NEXT:[r(a[10])] PREV:[r(10)]
r(a[10]) NEXT:[r(1)] PREV:[r(a)]
r(1) NEXT:[r(+=)] PREV:[r(a[10])]
r(+=) NEXT:[w(a[10])] PREV:[r(1)]
w(a[10]) NEXT:[<END>] PREV:[r(+=)]
v(val a = Array<Int>) NEXT:[call(Array, <init>)] PREV:[<START>]
call(Array, <init>) NEXT:[w(a)] PREV:[v(val a = Array<Int>)]
w(a) NEXT:[r(3)] PREV:[call(Array, <init>)]
r(3) NEXT:[r(a)] PREV:[w(a)]
r(a) NEXT:[r(10)] PREV:[r(3)]
r(10) NEXT:[r(4)] PREV:[r(a)]
r(4) NEXT:[call(a[10], set)] PREV:[r(10)]
call(a[10], set) NEXT:[r(2)] PREV:[r(4)]
r(2) NEXT:[r(a)] PREV:[call(a[10], set)]
r(a) NEXT:[r(10)] PREV:[r(2)]
r(10) NEXT:[call(a[10], get)] PREV:[r(a)]
call(a[10], get) NEXT:[r(100)] PREV:[r(10)]
r(100) NEXT:[r(a)] PREV:[call(a[10], get)]
r(a) NEXT:[r(10)] PREV:[r(100)]
r(10) NEXT:[call(a[10], get)] PREV:[r(a)]
call(a[10], get) NEXT:[r(1)] PREV:[r(10)]
r(1) NEXT:[call(+=, plus)] PREV:[call(a[10], get)]
call(+=, plus) NEXT:[r(a)] PREV:[r(1)]
r(a) NEXT:[r(10)] PREV:[call(+=, plus)]
r(10) NEXT:[call(a[10], set)] PREV:[r(a)]
call(a[10], get) NEXT:[<END>] PREV:[r(10)]
L1:
<END> NEXT:[<SINK>] PREV:[w(a[10])]
<END> NEXT:[<SINK>] PREV:[call(a[10], get)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
@@ -0,0 +1,20 @@
== foo ==
fun foo(a: Array<Int>) {
a[1] = 2
}
---------------------
L0:
<START> NEXT:[v(a: Array<Int>)] PREV:[]
v(a: Array<Int>) NEXT:[w(a)] PREV:[<START>]
w(a) NEXT:[r(a)] PREV:[v(a: Array<Int>)]
r(a) NEXT:[r(1)] PREV:[w(a)]
r(1) NEXT:[r(2)] PREV:[r(a)]
r(2) NEXT:[call(a[1], set)] PREV:[r(1)]
call(a[1], set) NEXT:[<END>] PREV:[r(2)]
L1:
<END> NEXT:[<SINK>] PREV:[call(a[1], set)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================
+3
View File
@@ -0,0 +1,3 @@
fun foo(a: Array<Int>) {
a[1] = 2
}