Test data fixed: mark() instructions added

This commit is contained in:
Andrey Breslav
2013-12-04 14:30:41 +04:00
parent e09d3aab3a
commit 87879ba654
37 changed files with 1358 additions and 976 deletions
@@ -21,16 +21,18 @@ L0:
r(34) r(34)
w(k) w(k)
v(val i: Int) v(val i: Int)
mark({ $i = 12 })
r(12) r(12)
w($i) w($i)
v(val j: Int get() = 20) v(val j: Int get() = 20)
jmp?(L2) NEXT:[r(13), d(get() = 20)] jmp?(L2) NEXT:[mark({ $i = 13 }), d(get() = 20)]
d(get() = 20) NEXT:[<SINK>] d(get() = 20) NEXT:[<SINK>]
L2: L2:
r(13) PREV:[jmp?(L2)] mark({ $i = 13 }) PREV:[jmp?(L2)]
r(13)
w($i) w($i)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
+32 -26
View File
@@ -10,33 +10,39 @@ fun foo() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val a = Array<Int>) mark({ val a = Array<Int> 3 a[10] = 4 2 a[10] 100 a[10] += 1 })
call(Array, <init>) v(val a = Array<Int>)
w(a) mark(Array<Int>)
r(3) call(Array, <init>)
r(a) w(a)
r(10) r(3)
r(4) mark(a[10])
call(a[10], set) r(a)
r(2) r(10)
r(a) r(4)
r(10) call(a[10], set)
call(a[10], get) r(2)
r(100) mark(a[10])
r(a) r(a)
r(10) r(10)
call(a[10], get) call(a[10], get)
r(1) r(100)
call(+=, plus) mark(a[10] += 1)
r(a) mark(a[10])
r(10) r(a)
r(1) r(10)
call(a[10], set) call(a[10], get)
r(1)
call(+=, plus)
r(a)
r(10)
r(1)
call(a[10], set)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+41 -37
View File
@@ -29,48 +29,52 @@ fun assignments() : Unit {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(var x = 1) mark({ var x = 1 x = 2 x += 2 x = if (true) 1 else 2 val y = true && false val z = false && true val t = Test(); t.x = 1 })
r(1) v(var x = 1)
w(x) r(1)
r(2) w(x)
w(x) r(2)
r(x) w(x)
r(2) mark(x += 2)
call(+=, plus) r(x)
w(x) r(2)
r(true) call(+=, plus)
jf(L2) NEXT:[r(2), r(1)] w(x)
r(1) mark(if (true) 1 else 2)
jmp(L3) NEXT:[w(x)] r(true)
jf(L2) NEXT:[r(2), r(1)]
r(1)
jmp(L3) NEXT:[w(x)]
L2: L2:
r(2) PREV:[jf(L2)] r(2) PREV:[jf(L2)]
L3: L3:
w(x) PREV:[jmp(L3), r(2)] w(x) PREV:[jmp(L3), r(2)]
v(val y = true && false) v(val y = true && false)
r(true) r(true)
jf(L4) NEXT:[r(true && false), r(false)] jf(L4) NEXT:[r(true && false), r(false)]
r(false) r(false)
L4: L4:
r(true && false) PREV:[jf(L4), r(false)] r(true && false) PREV:[jf(L4), r(false)]
w(y) w(y)
v(val z = false && true) v(val z = false && true)
r(false) r(false)
jf(L5) NEXT:[r(false && true), r(true)] jf(L5) NEXT:[r(false && true), r(true)]
r(true) r(true)
L5: L5:
r(false && true) PREV:[jf(L5), r(true)] r(false && true) PREV:[jf(L5), r(true)]
w(z) w(z)
v(val t = Test()) v(val t = Test())
call(Test, <init>) mark(Test())
w(t) call(Test, <init>)
r(1) w(t)
r(t) r(1)
w(t.x) r(t)
w(t.x)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+53 -37
View File
@@ -18,52 +18,64 @@ fun f(a : Boolean) : Unit {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a : Boolean) v(a : Boolean)
w(a) w(a)
r(1) mark({ 1 a 2.toLong() foo(a, 3) genfun<Any>() flfun {1} 3.equals(4) 3 equals 4 1 + 2 a && true a || false })
r(a) r(1)
r(2) r(a)
call(toLong, toLong) mark(2.toLong())
r(a) mark(toLong())
r(3) r(2)
call(foo, foo) call(toLong, toLong)
call(genfun, genfun) mark(foo(a, 3))
jmp?(L2) NEXT:[r({1}), d({1})] r(a)
d({1}) NEXT:[<SINK>] r(3)
call(foo, foo)
mark(genfun<Any>())
call(genfun, genfun)
mark(flfun {1})
mark({1})
jmp?(L2) NEXT:[r({1}), d({1})]
d({1}) NEXT:[<SINK>]
L2: L2:
r({1}) PREV:[jmp?(L2)] r({1}) PREV:[jmp?(L2)]
call(flfun, flfun) call(flfun, flfun)
r(3) mark(3.equals(4))
r(4) mark(equals(4))
call(equals, equals) r(3)
r(3) r(4)
r(4) call(equals, equals)
call(equals, equals) mark(3 equals 4)
r(1) r(3)
r(2) r(4)
call(+, plus) call(equals, equals)
r(a) mark(1 + 2)
jf(L5) NEXT:[r(a && true), r(true)] r(1)
r(true) r(2)
call(+, plus)
r(a)
jf(L5) NEXT:[r(a && true), r(true)]
r(true)
L5: L5:
r(a && true) PREV:[jf(L5), r(true)] r(a && true) PREV:[jf(L5), r(true)]
r(a) r(a)
jt(L6) NEXT:[r(false), r(a || false)] jt(L6) NEXT:[r(false), r(a || false)]
r(false) r(false)
L6: L6:
r(a || false) PREV:[jt(L6), r(false)] r(a || false) PREV:[jt(L6), r(false)]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>, d({1})] <SINK> PREV:[<ERROR>, <END>, d({1})]
L3: L3:
<START> <START>
mark(1)
r(1) r(1)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
@@ -74,9 +86,10 @@ sink:
--------------------- ---------------------
L3: L3:
<START> <START>
mark(1)
r(1) r(1)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
@@ -91,6 +104,7 @@ L0:
w(a) w(a)
v(b : Int) v(b : Int)
w(b) w(b)
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -104,6 +118,7 @@ fun genfun<T>() : Unit {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -119,6 +134,7 @@ L0:
<START> <START>
v(f : () -> Any) v(f : () -> Any)
w(f) w(f)
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -18,6 +18,7 @@ val a = Delegate()
L0: L0:
<START> <START>
v(val a = Delegate()) v(val a = Delegate())
mark(Delegate())
call(Delegate, <init>) call(Delegate, <init>)
w(a) w(a)
L1: L1:
@@ -3,6 +3,7 @@ fun empty() {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -4,13 +4,17 @@ fun fail() : Nothing {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
call(RuntimeException, <init>) mark({ throw java.lang.RuntimeException() })
throw (throw java.lang.RuntimeException()) NEXT:[<ERROR>] mark(throw java.lang.RuntimeException())
mark(java.lang.RuntimeException())
mark(RuntimeException())
call(RuntimeException, <init>)
throw (throw java.lang.RuntimeException()) NEXT:[<ERROR>]
L1: L1:
<END> NEXT:[<SINK>] PREV:[] <END> NEXT:[<SINK>] PREV:[]
error: error:
<ERROR> PREV:[throw (throw java.lang.RuntimeException())] <ERROR> PREV:[throw (throw java.lang.RuntimeException())]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -20,7 +20,7 @@ fun t2() {
fun t3() { fun t3() {
try { try {
1 1
@{ () => @{ () ->
if (2 > 3) { if (2 > 3) {
return@ return@
} }
@@ -31,7 +31,7 @@ fun t3() {
} }
fun t4() { fun t4() {
@{ () => @{ () ->
try { try {
1 1
if (2 > 3) { if (2 > 3) {
+164 -107
View File
@@ -3,6 +3,7 @@ fun doSmth() {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -16,6 +17,7 @@ fun doSmth1() {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -29,6 +31,7 @@ fun doSmth2() {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -42,6 +45,7 @@ fun cond() {}
--------------------- ---------------------
L0: L0:
<START> <START>
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -67,39 +71,49 @@ fun testCopy1() : Int {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } })
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(1), call(doSmth, doSmth)] mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 })
call(doSmth, doSmth) jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])]
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ return 1 }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L2 [onException]: L2 [onException]:
jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])]
v(e: NullPointerException) v(e: NullPointerException)
w(e) w(e)
call(doSmth1, doSmth1) mark({ doSmth1() })
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L5 [catch 0]: L5 [catch 0]:
v(e: Exception) PREV:[jmp?(L5 [catch 0])] v(e: Exception) PREV:[jmp?(L5 [catch 0])]
w(e) w(e)
call(doSmth2, doSmth2) mark({ doSmth2() })
jmp(L4 [afterCatches]) mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L4 [afterCatches])
L4 [afterCatches]: L4 [afterCatches]:
jmp(L6 [skipFinallyToErrorBlock]) NEXT:[r(1)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ return 1 })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
L3 [onExceptionToFinallyBlock]: L3 [onExceptionToFinallyBlock]:
L7 [start finally]: L7 [start finally]:
r(1) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] mark({ return 1 }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
ret(*) L1 NEXT:[<END>] r(1)
ret(*) L1 NEXT:[<END>]
L8 [finish finally]: L8 [finish finally]:
- jmp(error) NEXT:[<ERROR>] PREV:[] - jmp(error) NEXT:[<ERROR>] PREV:[]
L6 [skipFinallyToErrorBlock]: L6 [skipFinallyToErrorBlock]:
r(1) PREV:[jmp(L6 [skipFinallyToErrorBlock])] mark({ return 1 }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
ret(*) L1 r(1)
ret(*) L1
L1: L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1] <END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== testCopy2 == == testCopy2 ==
fun testCopy2() { fun testCopy2() {
@@ -121,55 +135,72 @@ fun testCopy2() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } })
mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
L2 [loop entry point]: L2 [loop entry point]:
L5 [condition entry point]: L5 [condition entry point]:
call(cond, cond) PREV:[<START>, jmp(L2 [loop entry point]), jmp(L2 [loop entry point])] mark(cond()) PREV:[mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } }), jmp(L2 [loop entry point]), jmp(L2 [loop entry point])]
jf(L3 [loop exit point]) NEXT:[read (Unit), jmp?(L6 [onException])] call(cond, cond)
jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })]
L4 [body entry point]: L4 [body entry point]:
jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue })
call(doSmth, doSmth) jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])]
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[mark({ if (cond()) return else continue }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
L6 [onException]: L6 [onException]:
jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])] jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])]
v(e: NullPointerException) v(e: NullPointerException)
w(e) w(e)
call(doSmth1, doSmth1) mark({ doSmth1() })
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
L9 [catch 0]: L9 [catch 0]:
v(e: Exception) PREV:[jmp?(L9 [catch 0])] v(e: Exception) PREV:[jmp?(L9 [catch 0])]
w(e) w(e)
call(doSmth2, doSmth2) mark({ doSmth2() })
jmp(L8 [afterCatches]) mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L8 [afterCatches])
L8 [afterCatches]: L8 [afterCatches]:
jmp(L10 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])] jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ if (cond()) return else continue })] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])]
L7 [onExceptionToFinallyBlock]: L7 [onExceptionToFinallyBlock]:
L11 [start finally]: L11 [start finally]:
call(cond, cond) PREV:[jmp?(L7 [onExceptionToFinallyBlock])] mark({ if (cond()) return else continue }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])]
jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] mark(if (cond()) return else continue)
ret L1 NEXT:[<END>] mark(cond())
- jmp(L13) NEXT:[jmp(error)] PREV:[] call(cond, cond)
jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1]
ret L1 NEXT:[<END>]
- jmp(L13) NEXT:[jmp(error)] PREV:[]
L12: L12:
jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(L12)] jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[jf(L12)]
L13: L13:
L14 [finish finally]: L14 [finish finally]:
- jmp(error) NEXT:[<ERROR>] PREV:[] - jmp(error) NEXT:[<ERROR>] PREV:[]
L10 [skipFinallyToErrorBlock]: L10 [skipFinallyToErrorBlock]:
call(cond, cond) PREV:[jmp(L10 [skipFinallyToErrorBlock])] mark({ if (cond()) return else continue }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] mark(if (cond()) return else continue)
ret L1 NEXT:[<END>] mark(cond())
- jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[] call(cond, cond)
jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(copy L12)] jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1]
- jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[] ret L1 NEXT:[<END>]
- jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[]
jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[jf(copy L12)]
- jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[]
L3 [loop exit point]: L3 [loop exit point]:
read (Unit) PREV:[jf(L3 [loop exit point])] read (Unit) PREV:[jf(L3 [loop exit point])]
L1: L1:
<END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)] <END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== testCopy3 == == testCopy3 ==
fun testCopy3() { fun testCopy3() {
@@ -188,47 +219,61 @@ fun testCopy3() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } })
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); })
call(doSmth, doSmth) jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])]
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ while (cond()); }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L2 [onException]: L2 [onException]:
jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])]
v(e: NullPointerException) v(e: NullPointerException)
w(e) w(e)
call(doSmth1, doSmth1) mark({ doSmth1() })
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L5 [catch 0]: L5 [catch 0]:
v(e: Exception) PREV:[jmp?(L5 [catch 0])] v(e: Exception) PREV:[jmp?(L5 [catch 0])]
w(e) w(e)
call(doSmth2, doSmth2) mark({ doSmth2() })
jmp(L4 [afterCatches]) mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L4 [afterCatches])
L4 [afterCatches]: L4 [afterCatches]:
jmp(L6 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ while (cond()); })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
L3 [onExceptionToFinallyBlock]: L3 [onExceptionToFinallyBlock]:
L7 [start finally]: L7 [start finally]:
mark({ while (cond()); }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(while (cond()))
L8 [loop entry point]: L8 [loop entry point]:
L11 [condition entry point]: L11 [condition entry point]:
call(cond, cond) PREV:[jmp?(L3 [onExceptionToFinallyBlock]), jmp(L8 [loop entry point])] mark(cond()) PREV:[mark(while (cond())), jmp(L8 [loop entry point])]
jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])] call(cond, cond)
jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])]
L10 [body entry point]: L10 [body entry point]:
jmp(L8 [loop entry point]) NEXT:[call(cond, cond)] jmp(L8 [loop entry point]) NEXT:[mark(cond())]
L9 [loop exit point]: L9 [loop exit point]:
read (Unit) PREV:[jf(L9 [loop exit point])] read (Unit) PREV:[jf(L9 [loop exit point])]
L12 [finish finally]: L12 [finish finally]:
jmp(error) NEXT:[<ERROR>] jmp(error) NEXT:[<ERROR>]
L6 [skipFinallyToErrorBlock]: L6 [skipFinallyToErrorBlock]:
call(cond, cond) PREV:[jmp(L6 [skipFinallyToErrorBlock]), jmp(copy L8 [loop entry point])] mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])] mark(while (cond()))
jmp(copy L8 [loop entry point]) NEXT:[call(cond, cond)] mark(cond()) PREV:[mark(while (cond())), jmp(copy L8 [loop entry point])]
read (Unit) PREV:[jf(copy L9 [loop exit point])] call(cond, cond)
jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])]
jmp(copy L8 [loop entry point]) NEXT:[mark(cond())]
read (Unit) PREV:[jf(copy L9 [loop exit point])]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[jmp(error)] <ERROR> PREV:[jmp(error)]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== doTestCopy4 == == doTestCopy4 ==
fun doTestCopy4(list: List<String>?) : Int { fun doTestCopy4(list: List<String>?) : Int {
@@ -242,37 +287,49 @@ fun doTestCopy4(list: List<String>?) : Int {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(list: List<String>?) v(list: List<String>?)
w(list) w(list)
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(list), call(doSmth, doSmth)] mark({ try { doSmth() } finally { if(list != null) { } } })
call(doSmth, doSmth) mark(try { doSmth() } finally { if(list != null) { } })
jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(list)] jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ if(list != null) { } }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ if(list != null) { } })]
L2 [onExceptionToFinallyBlock]: L2 [onExceptionToFinallyBlock]:
L4 [start finally]: L4 [start finally]:
r(list) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] mark({ if(list != null) { } }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(null) mark(if(list != null) { })
call(list != null, equals) mark(list != null)
jf(L5) NEXT:[read (Unit), read (Unit)] r(list)
read (Unit) r(null)
jmp(L6) NEXT:[jmp(error)] call(list != null, equals)
jf(L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L6) NEXT:[jmp(error)]
L5: L5:
read (Unit) PREV:[jf(L5)] read (Unit) PREV:[jf(L5)]
L6: L6:
L7 [finish finally]: L7 [finish finally]:
jmp(error) NEXT:[<ERROR>] PREV:[jmp(L6), read (Unit)] jmp(error) NEXT:[<ERROR>] PREV:[jmp(L6), read (Unit)]
L3 [skipFinallyToErrorBlock]: L3 [skipFinallyToErrorBlock]:
r(list) PREV:[jmp(L3 [skipFinallyToErrorBlock])] mark({ if(list != null) { } }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
r(null) mark(if(list != null) { })
call(list != null, equals) mark(list != null)
jf(copy L5) NEXT:[read (Unit), read (Unit)] r(list)
read (Unit) r(null)
jmp(copy L6) NEXT:[<END>] call(list != null, equals)
read (Unit) PREV:[jf(copy L5)] jf(copy L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(copy L6) NEXT:[<END>]
read (Unit) PREV:[jf(copy L5)]
L1: L1:
<END> NEXT:[<SINK>] PREV:[jmp(copy L6), read (Unit)] <END> NEXT:[<SINK>] PREV:[jmp(copy L6), read (Unit)]
error: error:
<ERROR> PREV:[jmp(error)] <ERROR> PREV:[jmp(error)]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+20 -14
View File
@@ -6,27 +6,32 @@ fun t1() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
r(1) mark({ for (i in 1..2) { doSmth(i) } })
r(2) mark(for (i in 1..2) { doSmth(i) })
call(.., rangeTo) mark(1..2)
v(i) r(1)
w(i) r(2)
call(.., rangeTo)
v(i)
w(i)
L3: L3:
jmp?(L2) NEXT:[read (Unit), r(i)] jmp?(L2) NEXT:[read (Unit), mark({ doSmth(i) })]
L4 [loop entry point]: L4 [loop entry point]:
L5 [body entry point]: L5 [body entry point]:
r(i) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] mark({ doSmth(i) }) PREV:[jmp?(L2), jmp?(L4 [loop entry point])]
call(doSmth, doSmth) mark(doSmth(i))
jmp?(L4 [loop entry point]) NEXT:[r(i), read (Unit)] r(i)
call(doSmth, doSmth)
jmp?(L4 [loop entry point]) NEXT:[mark({ doSmth(i) }), read (Unit)]
L2: L2:
read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== doSmth == == doSmth ==
fun doSmth(i: Int) {} fun doSmth(i: Int) {}
@@ -35,6 +40,7 @@ L0:
<START> <START>
v(i: Int) v(i: Int)
w(i) w(i)
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
+65 -46
View File
@@ -17,38 +17,49 @@ fun t1(b: Boolean) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(b: Boolean) v(b: Boolean)
w(b) w(b)
v(var u: String) mark({ var u: String if (b) { u = "s" } doSmth(u) var r: String if (b) { r = "s" } else { r = "t" } doSmth(r) })
r(b) v(var u: String)
jf(L2) NEXT:[read (Unit), r("s")] mark(if (b) { u = "s" })
r("s") r(b)
w(u) jf(L2) NEXT:[read (Unit), mark({ u = "s" })]
jmp(L3) NEXT:[r(u)] mark({ u = "s" })
mark("s")
r("s")
w(u)
jmp(L3) NEXT:[mark(doSmth(u))]
L2: L2:
read (Unit) PREV:[jf(L2)] read (Unit) PREV:[jf(L2)]
L3: L3:
r(u) PREV:[jmp(L3), read (Unit)] mark(doSmth(u)) PREV:[jmp(L3), read (Unit)]
call(doSmth, doSmth) r(u)
v(var r: String) call(doSmth, doSmth)
r(b) v(var r: String)
jf(L4) NEXT:[r("t"), r("s")] mark(if (b) { r = "s" } else { r = "t" })
r("s") r(b)
w(r) jf(L4) NEXT:[mark({ r = "t" }), mark({ r = "s" })]
jmp(L5) NEXT:[r(r)] mark({ r = "s" })
mark("s")
r("s")
w(r)
jmp(L5) NEXT:[mark(doSmth(r))]
L4: L4:
r("t") PREV:[jf(L4)] mark({ r = "t" }) PREV:[jf(L4)]
w(r) mark("t")
r("t")
w(r)
L5: L5:
r(r) PREV:[jmp(L5), w(r)] mark(doSmth(r)) PREV:[jmp(L5), w(r)]
call(doSmth, doSmth) r(r)
call(doSmth, doSmth)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== t2 == == t2 ==
fun t2(b: Boolean) { fun t2(b: Boolean) {
@@ -63,34 +74,41 @@ fun t2(b: Boolean) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(b: Boolean) v(b: Boolean)
w(b) w(b)
v(val i = 3) mark({ val i = 3 if (b) { return; } doSmth(i) if (i is Int) { return; } })
r(3) v(val i = 3)
w(i) r(3)
r(b) w(i)
jf(L2) NEXT:[read (Unit), ret L1] mark(if (b) { return; })
ret L1 NEXT:[<END>] r(b)
- jmp(L3) NEXT:[r(i)] PREV:[] jf(L2) NEXT:[read (Unit), mark({ return; })]
mark({ return; })
ret L1 NEXT:[<END>]
- jmp(L3) NEXT:[mark(doSmth(i))] PREV:[]
L2: L2:
read (Unit) PREV:[jf(L2)] read (Unit) PREV:[jf(L2)]
L3: L3:
r(i) mark(doSmth(i))
call(doSmth, doSmth) r(i)
r(i) call(doSmth, doSmth)
jf(L4) NEXT:[read (Unit), ret L1] mark(if (i is Int) { return; })
ret L1 NEXT:[<END>] mark(i is Int)
- jmp(L5) NEXT:[<END>] PREV:[] r(i)
jf(L4) NEXT:[read (Unit), mark({ return; })]
mark({ return; })
ret L1 NEXT:[<END>]
- jmp(L5) NEXT:[<END>] PREV:[]
L4: L4:
read (Unit) PREV:[jf(L4)] read (Unit) PREV:[jf(L4)]
L1: L1:
L5: L5:
<END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)] <END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== doSmth == == doSmth ==
fun doSmth(s: String) {} fun doSmth(s: String) {}
@@ -99,6 +117,7 @@ L0:
<START> <START>
v(s: String) v(s: String)
w(s) w(s)
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
+50 -42
View File
@@ -18,61 +18,69 @@ fun lazyBooleans(a : Boolean, b : Boolean) : Unit {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a : Boolean) v(a : Boolean)
w(a) w(a)
v(b : Boolean) v(b : Boolean)
w(b) w(b)
r(a) mark({ if (a) { 1 } else { 2 } 3 if (a && b) 5 else 6 7 if (a || b) 8 else 9 10 if (a) 11 12 if (a) else 13 14 })
jf(L2) NEXT:[r(2), r(1)] mark(if (a) { 1 } else { 2 })
r(1) r(a)
jmp(L3) NEXT:[r(3)] jf(L2) NEXT:[mark({ 2 }), mark({ 1 })]
mark({ 1 })
r(1)
jmp(L3) NEXT:[r(3)]
L2: L2:
r(2) PREV:[jf(L2)] mark({ 2 }) PREV:[jf(L2)]
r(2)
L3: L3:
r(3) PREV:[jmp(L3), r(2)] r(3) PREV:[jmp(L3), r(2)]
r(a) mark(if (a && b) 5 else 6)
jf(L4) NEXT:[jf(L5), r(b)] r(a)
r(b) jf(L4) NEXT:[jf(L5), r(b)]
r(b)
L4: L4:
jf(L5) NEXT:[r(6), r(5)] PREV:[jf(L4), r(b)] jf(L5) NEXT:[r(6), r(5)] PREV:[jf(L4), r(b)]
r(5) r(5)
jmp(L6) NEXT:[r(7)] jmp(L6) NEXT:[r(7)]
L5: L5:
r(6) PREV:[jf(L5)] r(6) PREV:[jf(L5)]
L6: L6:
r(7) PREV:[jmp(L6), r(6)] r(7) PREV:[jmp(L6), r(6)]
r(a) mark(if (a || b) 8 else 9)
jt(L7) NEXT:[r(b), jf(L8)] r(a)
r(b) jt(L7) NEXT:[r(b), jf(L8)]
r(b)
L7: L7:
jf(L8) NEXT:[r(9), r(8)] PREV:[jt(L7), r(b)] jf(L8) NEXT:[r(9), r(8)] PREV:[jt(L7), r(b)]
r(8) r(8)
jmp(L9) NEXT:[r(10)] jmp(L9) NEXT:[r(10)]
L8: L8:
r(9) PREV:[jf(L8)] r(9) PREV:[jf(L8)]
L9: L9:
r(10) PREV:[jmp(L9), r(9)] r(10) PREV:[jmp(L9), r(9)]
r(a) mark(if (a) 11)
jf(L10) NEXT:[read (Unit), r(11)] r(a)
r(11) jf(L10) NEXT:[read (Unit), r(11)]
jmp(L11) NEXT:[r(12)] r(11)
jmp(L11) NEXT:[r(12)]
L10: L10:
read (Unit) PREV:[jf(L10)] read (Unit) PREV:[jf(L10)]
L11: L11:
r(12) PREV:[jmp(L11), read (Unit)] r(12) PREV:[jmp(L11), read (Unit)]
r(a) mark(if (a) else 13)
jf(L12) NEXT:[r(13), read (Unit)] r(a)
read (Unit) jf(L12) NEXT:[r(13), read (Unit)]
jmp(L13) NEXT:[r(14)] read (Unit)
jmp(L13) NEXT:[r(14)]
L12: L12:
r(13) PREV:[jf(L12)] r(13) PREV:[jf(L12)]
L13: L13:
r(14) PREV:[jmp(L13), r(13)] r(14) PREV:[jmp(L13), r(13)]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -36,6 +36,7 @@ L0:
<START> <START>
v(i: Int) v(i: Int)
w(i) w(i)
mark({})
read (Unit) read (Unit)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -55,19 +56,22 @@ fun test1() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val a = object { val x : Int { $x = 1 } }) mark({ val a = object { val x : Int { $x = 1 } } })
v(val x : Int) v(val a = object { val x : Int { $x = 1 } })
r(1) mark(object { val x : Int { $x = 1 } })
w($x) v(val x : Int)
r(object { val x : Int { $x = 1 } }) mark({ $x = 1 })
w(a) r(1)
w($x)
r(object { val x : Int { $x = 1 } })
w(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== O == == O ==
object O { object O {
@@ -78,16 +82,17 @@ object O {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val x : Int) v(val x : Int)
r(1) mark({ $x = 1 })
w($x) r(1)
w($x)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== test2 == == test2 ==
fun test2() { fun test2() {
@@ -98,22 +103,24 @@ fun test2() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val b = 1) mark({ val b = 1 val a = object { val x = b } })
r(1) v(val b = 1)
w(b) r(1)
v(val a = object { val x = b }) w(b)
v(val x = b) v(val a = object { val x = b })
r(b) mark(object { val x = b })
w(x) v(val x = b)
r(object { val x = b }) r(b)
w(a) w(x)
r(object { val x = b })
w(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== test3 == == test3 ==
fun test3() { fun test3() {
@@ -126,30 +133,33 @@ fun test3() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val a = object { val y : Int fun inner_bar() { y = 10 } }) mark({ val a = object { val y : Int fun inner_bar() { y = 10 } } })
v(val y : Int) v(val a = object { val y : Int fun inner_bar() { y = 10 } })
jmp?(L2) NEXT:[r(object { val y : Int fun inner_bar() { y = 10 } }), d(fun inner_bar() { y = 10 })] mark(object { val y : Int fun inner_bar() { y = 10 } })
d(fun inner_bar() { y = 10 }) NEXT:[<SINK>] v(val y : Int)
jmp?(L2) NEXT:[r(object { val y : Int fun inner_bar() { y = 10 } }), d(fun inner_bar() { y = 10 })]
d(fun inner_bar() { y = 10 }) NEXT:[<SINK>]
L2: L2:
r(object { val y : Int fun inner_bar() { y = 10 } }) PREV:[jmp?(L2)] r(object { val y : Int fun inner_bar() { y = 10 } }) PREV:[jmp?(L2)]
w(a) w(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>, d(fun inner_bar() { y = 10 })] <SINK> PREV:[<ERROR>, <END>, d(fun inner_bar() { y = 10 })]
L3: L3:
<START> <START>
r(10) mark({ y = 10 })
w(y) r(10)
w(y)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== inner_bar == == inner_bar ==
fun inner_bar() { fun inner_bar() {
@@ -157,15 +167,16 @@ fun inner_bar() {
} }
--------------------- ---------------------
L3: L3:
<START> <START>
r(10) mark({ y = 10 })
w(y) r(10)
w(y)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== test4 == == test4 ==
fun test4() { fun test4() {
@@ -182,33 +193,37 @@ fun test4() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) mark({ val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } })
v(val x : Int) v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
v(val y : Int) mark(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
r(1) v(val x : Int)
w($x) v(val y : Int)
jmp?(L2) NEXT:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }), d(fun ggg() { y = 10 })] mark({ $x = 1 })
d(fun ggg() { y = 10 }) NEXT:[<SINK>] r(1)
w($x)
jmp?(L2) NEXT:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }), d(fun ggg() { y = 10 })]
d(fun ggg() { y = 10 }) NEXT:[<SINK>]
L2: L2:
r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) PREV:[jmp?(L2)] r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) PREV:[jmp?(L2)]
w(a) w(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>, d(fun ggg() { y = 10 })] <SINK> PREV:[<ERROR>, <END>, d(fun ggg() { y = 10 })]
L3: L3:
<START> <START>
r(10) mark({ y = 10 })
w(y) r(10)
w(y)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== ggg == == ggg ==
fun ggg() { fun ggg() {
@@ -216,15 +231,16 @@ fun ggg() {
} }
--------------------- ---------------------
L3: L3:
<START> <START>
r(10) mark({ y = 10 })
w(y) r(10)
w(y)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== test5 == == test5 ==
fun test5() { fun test5() {
@@ -243,47 +259,52 @@ fun test5() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) mark({ val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } })
v(var x = 1) v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
r(1) mark(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
w(x) v(var x = 1)
r(2) r(1)
w($x) w(x)
jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })] mark({ $x = 2 })
d(fun foo() { x = 3 }) NEXT:[<SINK>] r(2)
w($x)
jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })]
d(fun foo() { x = 3 }) NEXT:[<SINK>]
L2: L2:
jmp?(L5) NEXT:[r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }), d(fun bar() { x = 4 })] PREV:[jmp?(L2)] jmp?(L5) NEXT:[r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }), d(fun bar() { x = 4 })] PREV:[jmp?(L2)]
d(fun bar() { x = 4 }) NEXT:[<SINK>] d(fun bar() { x = 4 }) NEXT:[<SINK>]
L5: L5:
r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) PREV:[jmp?(L5)] r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) PREV:[jmp?(L5)]
w(a) w(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>, d(fun foo() { x = 3 }), d(fun bar() { x = 4 })] <SINK> PREV:[<ERROR>, <END>, d(fun foo() { x = 3 }), d(fun bar() { x = 4 })]
L3: L3:
<START> <START>
r(3) mark({ x = 3 })
w(x) r(3)
w(x)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
L6: L6:
<START> <START>
r(4) mark({ x = 4 })
w(x) r(4)
w(x)
L7: L7:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== foo == == foo ==
fun foo() { fun foo() {
@@ -291,15 +312,16 @@ fun foo() {
} }
--------------------- ---------------------
L3: L3:
<START> <START>
r(3) mark({ x = 3 })
w(x) r(3)
w(x)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== bar == == bar ==
fun bar() { fun bar() {
@@ -307,13 +329,14 @@ fun bar() {
} }
--------------------- ---------------------
L6: L6:
<START> <START>
r(4) mark({ x = 4 })
w(x) r(4)
w(x)
L7: L7:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+17 -16
View File
@@ -20,23 +20,24 @@ fun test(c: C) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(c: C) v(c: C)
w(c) w(c)
r(c) mark({ val (a, b) = c val d = 1 })
v(a) r(c)
call(a, component1) v(a)
w(a) call(a, component1)
v(b) w(a)
call(b, component2) v(b)
w(b) call(b, component2)
v(val d = 1) w(b)
r(1) v(val d = 1)
w(d) r(1)
w(d)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -34,20 +34,24 @@ fun foo(b: B) : Int {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(b: B) v(b: B)
w(b) w(b)
v(val o = object : A by b {}) mark({ val o = object : A by b {} return o.foo() })
r(b) v(val o = object : A by b {})
r(object : A by b {}) mark(object : A by b {})
w(o) r(b)
r(o) r(object : A by b {})
call(foo, foo) w(o)
ret(*) L1 mark(o.foo())
mark(foo())
r(o)
call(foo, foo)
ret(*) L1
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -6,24 +6,28 @@ fun main() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
mark({ while(1 > 0) { 2 } })
mark(while(1 > 0) { 2 })
L2 [loop entry point]: L2 [loop entry point]:
L5 [condition entry point]: L5 [condition entry point]:
r(1) PREV:[<START>, jmp(L2 [loop entry point])] mark(1 > 0) PREV:[mark(while(1 > 0) { 2 }), jmp(L2 [loop entry point])]
r(0) r(1)
call(>, compareTo) r(0)
jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] call(>, compareTo)
jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ 2 })]
L4 [body entry point]: L4 [body entry point]:
r(2) mark({ 2 })
jmp(L2 [loop entry point]) NEXT:[r(1)] r(2)
jmp(L2 [loop entry point]) NEXT:[mark(1 > 0)]
L3 [loop exit point]: L3 [loop exit point]:
read (Unit) PREV:[jf(L3 [loop exit point])] read (Unit) PREV:[jf(L3 [loop exit point])]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
== dowhile == == dowhile ==
fun dowhile() { fun dowhile() {
@@ -32,21 +36,25 @@ fun dowhile() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
mark({ do {return} while(1 > 0) })
mark(do {return} while(1 > 0))
L2 [loop entry point]: L2 [loop entry point]:
L4 [body entry point]: L4 [body entry point]:
ret L1 NEXT:[<END>] mark({return})
ret L1 NEXT:[<END>]
L5 [condition entry point]: L5 [condition entry point]:
- r(1) PREV:[] - mark(1 > 0) PREV:[]
- r(0) PREV:[] - r(1) PREV:[]
- call(>, compareTo) PREV:[] - r(0) PREV:[]
- jt(L2 [loop entry point]) NEXT:[read (Unit), ret L1] PREV:[] - call(>, compareTo) PREV:[]
- jt(L2 [loop entry point]) NEXT:[read (Unit), mark({return})] PREV:[]
L3 [loop exit point]: L3 [loop exit point]:
- read (Unit) PREV:[] - read (Unit) PREV:[]
L1: L1:
<END> NEXT:[<SINK>] PREV:[ret L1] <END> NEXT:[<SINK>] PREV:[ret L1]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -4,17 +4,19 @@ fun blockAndAndMismatch() : Boolean {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
r(false) mark({ false || (return false) })
jt(L2) NEXT:[r(false), r(false || (return false))] r(false)
r(false) jt(L2) NEXT:[mark((return false)), r(false || (return false))]
ret(*) L1 NEXT:[<END>] mark((return false))
r(false)
ret(*) L1 NEXT:[<END>]
L2: L2:
r(false || (return false)) PREV:[jt(L2)] r(false || (return false)) PREV:[jt(L2)]
L1: L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, r(false || (return false))] <END> NEXT:[<SINK>] PREV:[ret(*) L1, r(false || (return false))]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -21,6 +21,10 @@ L0:
<START> <START>
v(ab: Ab) v(ab: Ab)
w(ab) w(ab)
mark({ ab.getArray()[1] })
mark(ab.getArray()[1])
mark(ab.getArray())
mark(getArray())
r(ab) r(ab)
call(getArray, getArray) call(getArray, getArray)
r(1) r(1)
+12 -10
View File
@@ -4,17 +4,19 @@ fun foo(a: Array<Int>) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a: Array<Int>) v(a: Array<Int>)
w(a) w(a)
r(a) mark({ a[1] = 2 })
r(1) mark(a[1])
r(2) r(a)
call(a[1], set) r(1)
r(2)
call(a[1], set)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -4,22 +4,25 @@ fun foo(a: Array<Int>) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a: Array<Int>) v(a: Array<Int>)
w(a) w(a)
r(a) mark({ a[0] += 1 })
r(0) mark(a[0] += 1)
call(a[0], get) mark(a[0])
r(1) r(a)
call(+=, plus) r(0)
r(a) call(a[0], get)
r(0) r(1)
r(1) call(+=, plus)
call(a[0], set) r(a)
r(0)
r(1)
call(a[0], set)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -7,6 +7,7 @@ L0:
<START> <START>
v(c: C) v(c: C)
w(c) w(c)
mark({ this = c })
r(c) r(c)
unsupported(BINARY_EXPRESSION : this = c) unsupported(BINARY_EXPRESSION : this = c)
L1: L1:
@@ -11,12 +11,13 @@ class C {
L0: L0:
<START> <START>
v(val a: Int get() = 1) v(val a: Int get() = 1)
jmp?(L2) NEXT:[r($a), d(get() = 1)] jmp?(L2) NEXT:[mark({ $a }), d(get() = 1)]
d(get() = 1) NEXT:[<SINK>] d(get() = 1) NEXT:[<SINK>]
L2: L2:
r($a) PREV:[jmp?(L2)] mark({ $a }) PREV:[jmp?(L2)]
r($a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
@@ -5,14 +5,18 @@ fun test() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
call(Exception, <init>) mark({ throw Exception() test() })
throw (throw Exception()) NEXT:[<ERROR>] mark(throw Exception())
- call(test, test) PREV:[] mark(Exception())
call(Exception, <init>)
throw (throw Exception()) NEXT:[<ERROR>]
- mark(test()) PREV:[]
- call(test, test) PREV:[]
L1: L1:
<END> NEXT:[<SINK>] PREV:[] <END> NEXT:[<SINK>] PREV:[]
error: error:
<ERROR> PREV:[throw (throw Exception())] <ERROR> PREV:[throw (throw Exception())]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -4,15 +4,16 @@ fun foo() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
ret L1 NEXT:[<END>] mark({ return ?: null })
- jt(L2) NEXT:[r(null), <END>] PREV:[] ret L1 NEXT:[<END>]
- r(null) PREV:[] - jt(L2) NEXT:[r(null), <END>] PREV:[]
- r(null) PREV:[]
L1: L1:
L2: L2:
<END> NEXT:[<SINK>] PREV:[ret L1] <END> NEXT:[<SINK>] PREV:[ret L1]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+19 -15
View File
@@ -5,24 +5,28 @@ fun foo(a: Int, b: Int) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a: Int) v(a: Int)
w(a) w(a)
v(b: Int) v(b: Int)
w(b) w(b)
r(a) mark({ if (a == b) { } })
r(b) mark(if (a == b) { })
call(a == b, equals) mark(a == b)
jf(L2) NEXT:[read (Unit), read (Unit)] r(a)
read (Unit) r(b)
jmp(L3) NEXT:[<END>] call(a == b, equals)
jf(L2) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L3) NEXT:[<END>]
L2: L2:
read (Unit) PREV:[jf(L2)] read (Unit) PREV:[jf(L2)]
L1: L1:
L3: L3:
<END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)] <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -7,6 +7,9 @@ L0:
<START> <START>
v(f: () -> Unit) v(f: () -> Unit)
w(f) w(f)
mark({ (f)() })
mark((f)())
mark((f))
r(f) r(f)
call((f), <for expression (f)>) call((f), <for expression (f)>)
L1: L1:
@@ -5,17 +5,19 @@ fun foo() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(var i = 1) mark({ var i = 1 i++ })
r(1) v(var i = 1)
w(i) r(1)
r(i) w(i)
call(++, inc) mark(i++)
w(i) r(i)
call(++, inc)
w(i)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -7,6 +7,8 @@ L0:
<START> <START>
v(f: () -> Unit) v(f: () -> Unit)
w(f) w(f)
mark({ f() })
mark(f())
r(f) r(f)
call(f, invoke) call(f, invoke)
L1: L1:
@@ -5,19 +5,20 @@ fun foo(x: Int) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(x: Int) v(x: Int)
w(x) w(x)
r(x) mark({ val (a, b) = x a })
v(a) r(x)
w(a) v(a)
v(b) w(a)
w(b) v(b)
r(a) w(b)
r(a)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
+19 -15
View File
@@ -4,24 +4,28 @@ fun neq(a: Int, b: Int) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a: Int) v(a: Int)
w(a) w(a)
v(b: Int) v(b: Int)
w(b) w(b)
r(a) mark({ if (a != b) {} })
r(b) mark(if (a != b) {})
call(a != b, equals) mark(a != b)
jf(L2) NEXT:[read (Unit), read (Unit)] r(a)
read (Unit) r(b)
jmp(L3) NEXT:[<END>] call(a != b, equals)
jf(L2) NEXT:[read (Unit), mark({})]
mark({})
read (Unit)
jmp(L3) NEXT:[<END>]
L2: L2:
read (Unit) PREV:[jf(L2)] read (Unit) PREV:[jf(L2)]
L1: L1:
L3: L3:
<END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)] <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -4,15 +4,17 @@ fun test(s: String?) {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(s: String?) v(s: String?)
w(s) w(s)
r(s) mark({ s?.length })
r(length) mark(s?.length)
r(s)
r(length)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>] <SINK> PREV:[<ERROR>, <END>]
===================== =====================
@@ -6,17 +6,17 @@ fun illegalWhenBlock(a: Any): Any {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
v(a: Any) v(a: Any)
w(a) w(a)
mark({ when(a) { is Int -> return a } }) mark({ when(a) { is Int -> return a } })
mark(when(a) { is Int -> return a }) mark(when(a) { is Int -> return a })
r(a) r(a)
mark(is Int -> return a) mark(is Int -> return a)
jmp?(L4) NEXT:[<END>, r(a)] jmp?(L4) NEXT:[<END>, r(a)]
L3: L3:
r(a) r(a)
ret(*) L1 NEXT:[<END>] ret(*) L1 NEXT:[<END>]
- jmp(L2) PREV:[] - jmp(L2) PREV:[]
L1: L1:
L2: L2:
@@ -5,6 +5,8 @@ fun Function0<Unit>.foo() {
--------------------- ---------------------
L0: L0:
<START> <START>
mark({ this() })
mark(this())
r(this) r(this)
call(this, <for expression this>) call(this, <for expression this>)
L1: L1:
@@ -5,6 +5,7 @@ fun <T> foo() {
--------------------- ---------------------
L0: L0:
<START> <START>
mark({ T })
error(T, No resolved call) error(T, No resolved call)
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -7,6 +7,9 @@ L0:
<START> <START>
v(a: Any) v(a: Any)
w(a) w(a)
mark({ a.foo() })
mark(a.foo())
mark(foo())
error(foo, No resolved call) error(foo, No resolved call)
error(foo, No resolved call) error(foo, No resolved call)
r(a) r(a)
@@ -4,19 +4,22 @@ fun foo() {
} }
--------------------- ---------------------
L0: L0:
<START> <START>
jmp?(L2) NEXT:[r({}), d({})] mark({ {} })
d({}) NEXT:[<SINK>] mark({})
jmp?(L2) NEXT:[r({}), d({})]
d({}) NEXT:[<SINK>]
L2: L2:
r({}) PREV:[jmp?(L2)] r({}) PREV:[jmp?(L2)]
L1: L1:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
error: error:
<ERROR> PREV:[] <ERROR> PREV:[]
sink: sink:
<SINK> PREV:[<ERROR>, <END>, d({})] <SINK> PREV:[<ERROR>, <END>, d({})]
L3: L3:
<START> <START>
mark()
read (Unit) read (Unit)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]
@@ -30,6 +33,7 @@ sink:
--------------------- ---------------------
L3: L3:
<START> <START>
mark()
read (Unit) read (Unit)
L4: L4:
<END> NEXT:[<SINK>] <END> NEXT:[<SINK>]