diff --git a/compiler/testData/cfg/AnonymousInitializers.instructions b/compiler/testData/cfg/AnonymousInitializers.instructions index 46519de211b..6f79af92955 100644 --- a/compiler/testData/cfg/AnonymousInitializers.instructions +++ b/compiler/testData/cfg/AnonymousInitializers.instructions @@ -16,30 +16,30 @@ class AnonymousInitializers() { } --------------------- L0: - - v(val k = 34) - r(34) - w(k) - v(val i: Int) - mark({ $i = 12 }) - r(12) - w($i) + + v(val k = 34) + r(34) + w(k) + v(val i: Int) + mark({ $i = 12 }) + r(12) + w($i) v(val j: Int get() = 20) jmp?(L2) NEXT:[mark({ $i = 13 }), d(get() = 20)] - d(get() = 20) NEXT:[] + d(get() = 20) NEXT:[] L2: mark({ $i = 13 }) PREV:[jmp?(L2)] - r(13) - w($i) + r(13) + w($i) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d(get() = 20)] L3: - r(20) + r(20) L4: NEXT:[] error: @@ -52,7 +52,7 @@ get() = 20 --------------------- L3: - r(20) + r(20) L4: NEXT:[] error: diff --git a/compiler/testData/cfg/ArrayAccess.instructions b/compiler/testData/cfg/ArrayAccess.instructions index 8e42eb99d62..7b84e4843fb 100644 --- a/compiler/testData/cfg/ArrayAccess.instructions +++ b/compiler/testData/cfg/ArrayAccess.instructions @@ -10,37 +10,37 @@ fun foo() { } --------------------- L0: - + mark({ val a = Array 3 a[10] = 4 2 a[10] 100 a[10] += 1 }) - v(val a = Array) - mark(Array) - call(Array, ) - w(a) - r(3) - mark(a[10]) - r(a) - r(10) - r(4) - call(a[10], set) - r(2) - mark(a[10]) - r(a) - r(10) - call(a[10], get) - r(100) - mark(a[10] += 1) - mark(a[10]) - r(a) - r(10) - call(a[10], get) - r(1) - call(+=, plus) - r(a) - r(10) - r(1) - call(a[10], set) + v(val a = Array) + mark(Array) + call(Array, ) + w(a) + r(3) + mark(a[10]) + r(a) + r(10) + r(4) + call(a[10], set) + r(2) + mark(a[10]) + r(a) + r(10) + call(a[10], get) + r(100) + mark(a[10] += 1) + mark(a[10]) + r(a) + r(10) + call(a[10], get) + r(1) + call(+=, plus) + r(a) + r(10) + r(1) + call(a[10], set) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/Assignments.instructions b/compiler/testData/cfg/Assignments.instructions index 5d279c50b33..8fcbf55c320 100644 --- a/compiler/testData/cfg/Assignments.instructions +++ b/compiler/testData/cfg/Assignments.instructions @@ -4,10 +4,10 @@ class Test { } --------------------- L0: - + v(var x : Int;) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -29,50 +29,50 @@ fun assignments() : Unit { } --------------------- L0: - + 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 }) - v(var x = 1) - r(1) - w(x) - r(2) - w(x) - mark(x += 2) - r(x) - r(2) - call(+=, plus) - w(x) - mark(if (true) 1 else 2) - r(true) - jf(L2) NEXT:[r(2), r(1)] - r(1) - jmp(L3) NEXT:[w(x)] + v(var x = 1) + r(1) + w(x) + r(2) + w(x) + mark(x += 2) + r(x) + r(2) + call(+=, plus) + w(x) + mark(if (true) 1 else 2) + r(true) + jf(L2) NEXT:[r(2), r(1)] + r(1) + jmp(L3) NEXT:[w(x)] L2: r(2) PREV:[jf(L2)] L3: w(x) PREV:[jmp(L3), r(2)] - v(val y = true && false) - r(true) - jf(L4) NEXT:[r(true && false), r(false)] - r(false) + v(val y = true && false) + r(true) + jf(L4) NEXT:[r(true && false), r(false)] + r(false) L4: r(true && false) PREV:[jf(L4), r(false)] - w(y) - v(val z = false && true) - r(false) - jf(L5) NEXT:[r(false && true), r(true)] - r(true) + w(y) + v(val z = false && true) + r(false) + jf(L5) NEXT:[r(false && true), r(true)] + r(true) L5: r(false && true) PREV:[jf(L5), r(true)] - w(z) - v(val t = Test()) - mark(Test()) - call(Test, ) - w(t) - r(1) - r(t) - w(t.x) + w(z) + v(val t = Test()) + mark(Test()) + call(Test, ) + w(t) + r(1) + r(t) + w(t.x) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/Basic.instructions b/compiler/testData/cfg/Basic.instructions index 4a39a213c89..a8f188b5085 100644 --- a/compiler/testData/cfg/Basic.instructions +++ b/compiler/testData/cfg/Basic.instructions @@ -18,54 +18,54 @@ fun f(a : Boolean) : Unit { } --------------------- L0: - - v(a : Boolean) - w(a) + + v(a : Boolean) + w(a) mark({ 1 a 2.toLong() foo(a, 3) genfun() flfun {1} 3.equals(4) 3 equals 4 1 + 2 a && true a || false }) - r(1) - r(a) - mark(2.toLong()) - mark(toLong()) - r(2) - call(toLong, toLong) - mark(foo(a, 3)) - r(a) - r(3) - call(foo, foo) - mark(genfun()) - call(genfun, genfun) - mark(flfun {1}) - mark({1}) - jmp?(L2) NEXT:[r({1}), d({1})] - d({1}) NEXT:[] + r(1) + r(a) + mark(2.toLong()) + mark(toLong()) + r(2) + call(toLong, toLong) + mark(foo(a, 3)) + r(a) + r(3) + call(foo, foo) + mark(genfun()) + call(genfun, genfun) + mark(flfun {1}) + mark({1}) + jmp?(L2) NEXT:[r({1}), d({1})] + d({1}) NEXT:[] L2: r({1}) PREV:[jmp?(L2)] - call(flfun, flfun) - mark(3.equals(4)) - mark(equals(4)) - r(3) - r(4) - call(equals, equals) - mark(3 equals 4) - r(3) - r(4) - call(equals, equals) - mark(1 + 2) - r(1) - r(2) - call(+, plus) - r(a) - jf(L5) NEXT:[r(a && true), r(true)] - r(true) + call(flfun, flfun) + mark(3.equals(4)) + mark(equals(4)) + r(3) + r(4) + call(equals, equals) + mark(3 equals 4) + r(3) + r(4) + call(equals, equals) + mark(1 + 2) + r(1) + r(2) + call(+, plus) + r(a) + jf(L5) NEXT:[r(a && true), r(true)] + r(true) L5: r(a && true) PREV:[jf(L5), r(true)] - r(a) - jt(L6) NEXT:[r(false), r(a || false)] - r(false) + r(a) + jt(L6) NEXT:[r(false), r(a || false)] + r(false) L6: r(a || false) PREV:[jt(L6), r(false)] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -73,9 +73,9 @@ sink: L3: mark(1) - r(1) + r(1) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -87,9 +87,9 @@ sink: L3: mark(1) - r(1) + r(1) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -99,15 +99,15 @@ sink: fun foo(a : Boolean, b : Int) : Unit {} --------------------- L0: - + v(a : Boolean) - w(a) - v(b : Int) - w(b) - mark({}) - read (Unit) + w(a) + v(b : Int) + w(b) + mark({}) + read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -117,11 +117,11 @@ sink: fun genfun() : Unit {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -131,13 +131,13 @@ sink: fun flfun(f : () -> Any) : Unit {} --------------------- L0: - + v(f : () -> Any) - w(f) - mark({}) - read (Unit) + w(f) + mark({}) + read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/DelegatedProperty.instructions b/compiler/testData/cfg/DelegatedProperty.instructions index c4092a14a3d..75147d933f2 100644 --- a/compiler/testData/cfg/DelegatedProperty.instructions +++ b/compiler/testData/cfg/DelegatedProperty.instructions @@ -16,13 +16,13 @@ sink: val a = Delegate() --------------------- L0: - - v(val a = Delegate()) - mark(Delegate()) + + v(val a = Delegate()) + mark(Delegate()) call(Delegate, ) - w(a) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -32,11 +32,11 @@ sink: val b by a --------------------- L0: - + v(val b by a) - r(a) + r(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/EmptyFunction.instructions b/compiler/testData/cfg/EmptyFunction.instructions index 0ac05d7378e..1f16dc425cb 100644 --- a/compiler/testData/cfg/EmptyFunction.instructions +++ b/compiler/testData/cfg/EmptyFunction.instructions @@ -2,11 +2,11 @@ fun empty() {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/FailFunction.instructions b/compiler/testData/cfg/FailFunction.instructions index 71146eb9cfa..62c235de482 100644 --- a/compiler/testData/cfg/FailFunction.instructions +++ b/compiler/testData/cfg/FailFunction.instructions @@ -4,13 +4,13 @@ fun fail() : Nothing { } --------------------- L0: - + mark({ throw java.lang.RuntimeException() }) - mark(throw java.lang.RuntimeException()) - mark(java.lang.RuntimeException()) - mark(RuntimeException()) - call(RuntimeException, ) - throw (throw java.lang.RuntimeException()) NEXT:[] + mark(throw java.lang.RuntimeException()) + mark(java.lang.RuntimeException()) + mark(RuntimeException()) + call(RuntimeException, ) + throw (throw java.lang.RuntimeException()) NEXT:[] L1: NEXT:[] PREV:[] error: diff --git a/compiler/testData/cfg/Finally.instructions b/compiler/testData/cfg/Finally.instructions index 5d06aa9302b..53be85641cb 100644 --- a/compiler/testData/cfg/Finally.instructions +++ b/compiler/testData/cfg/Finally.instructions @@ -8,24 +8,24 @@ fun t1() { } --------------------- L0: - - mark({ try { 1 } finally { 2 } }) - mark(try { 1 } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 })] - mark({ 1 }) - r(1) - jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + + mark({ try { 1 } finally { 2 } }) + mark(try { 1 } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 })] + mark({ 1 }) + r(1) + jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L4 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L5 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L3 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L3 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -44,36 +44,36 @@ fun t2() { } --------------------- L0: - + mark({ try { 1 if (2 > 3) { return } } finally { 2 } }) - mark(try { 1 if (2 > 3) { return } } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return } })] - mark({ 1 if (2 > 3) { return } }) - r(1) - mark(if (2 > 3) { return }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L3) NEXT:[read (Unit), mark({ return })] - mark({ return }) + mark(try { 1 if (2 > 3) { return } } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return } })] + mark({ 1 if (2 > 3) { return } }) + r(1) + mark(if (2 > 3) { return }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L3) NEXT:[read (Unit), mark({ return })] + mark({ return }) L4 [start finally]: - mark({ 2 }) - r(2) + mark({ 2 }) + r(2) L5 [finish finally]: - ret L1 NEXT:[] + ret L1 NEXT:[] - jmp(L6) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L3: read (Unit) PREV:[jf(L3)] L6: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) - jmp(error) NEXT:[] + r(2) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L7 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: NEXT:[] PREV:[ret L1, r(2)] error: @@ -96,45 +96,45 @@ fun t3() { } --------------------- L0: - + mark({ try { 1 @{ () -> if (2 > 3) { return@ } } } finally { 2 } }) - mark(try { 1 @{ () -> if (2 > 3) { return@ } } } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 @{ () -> if (2 > 3) { return@ } } })] - mark({ 1 @{ () -> if (2 > 3) { return@ } } }) - r(1) - mark(@{ () -> if (2 > 3) { return@ } }) - mark({ () -> if (2 > 3) { return@ } }) + mark(try { 1 @{ () -> if (2 > 3) { return@ } } } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 @{ () -> if (2 > 3) { return@ } } })] + mark({ 1 @{ () -> if (2 > 3) { return@ } } }) + r(1) + mark(@{ () -> if (2 > 3) { return@ } }) + mark({ () -> if (2 > 3) { return@ } }) jmp?(L3) NEXT:[r({ () -> if (2 > 3) { return@ } }), d({ () -> if (2 > 3) { return@ } })] - d({ () -> if (2 > 3) { return@ } }) NEXT:[] + d({ () -> if (2 > 3) { return@ } }) NEXT:[] L3: r({ () -> if (2 > 3) { return@ } }) PREV:[jmp?(L3)] - jmp(L8 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L8 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L9 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L10 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L8 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L8 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: PREV:[, , d({ () -> if (2 > 3) { return@ } })] L4: - + mark(if (2 > 3) { return@ }) mark(if (2 > 3) { return@ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) jf(L6) NEXT:[read (Unit), mark({ return@ })] - mark({ return@ }) - ret L5 NEXT:[] + mark({ return@ }) + ret L5 NEXT:[] - jmp(L7) NEXT:[] PREV:[] L6: read (Unit) PREV:[jf(L6)] @@ -154,16 +154,16 @@ sink: } --------------------- L4: - + mark(if (2 > 3) { return@ }) mark(if (2 > 3) { return@ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) jf(L6) NEXT:[read (Unit), mark({ return@ })] - mark({ return@ }) - ret L5 NEXT:[] + mark({ return@ }) + ret L5 NEXT:[] - jmp(L7) NEXT:[] PREV:[] L6: read (Unit) PREV:[jf(L6)] @@ -190,51 +190,51 @@ fun t4() { } --------------------- L0: - + mark({ @{ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } } }) - mark(@{ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) - mark({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) + mark(@{ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) + mark({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) jmp?(L2) NEXT:[r({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }), d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })] - d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[] + d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[] L2: r({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) PREV:[jmp?(L2)] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })] L3: - + mark(try { 1 if (2 > 3) { return@ } } finally { 2 }) mark(try { 1 if (2 > 3) { return@ } } finally { 2 }) - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })] - mark({ 1 if (2 > 3) { return@ } }) - r(1) - mark(if (2 > 3) { return@ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L6) NEXT:[read (Unit), mark({ return@ })] - mark({ return@ }) + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })] + mark({ 1 if (2 > 3) { return@ } }) + r(1) + mark(if (2 > 3) { return@ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), mark({ return@ })] + mark({ return@ }) L7 [start finally]: - mark({ 2 }) - r(2) + mark({ 2 }) + r(2) L8 [finish finally]: - ret L4 NEXT:[] + ret L4 NEXT:[] - jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[] L6: read (Unit) PREV:[jf(L6)] L9: - jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L5 [onExceptionToFinallyBlock]: mark({ 2 }) PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - r(2) - jmp(error) NEXT:[] + r(2) + jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])] - r(2) + r(2) L4: NEXT:[] PREV:[ret L4, r(2)] error: @@ -255,36 +255,36 @@ sink: } --------------------- L3: - + mark(try { 1 if (2 > 3) { return@ } } finally { 2 }) mark(try { 1 if (2 > 3) { return@ } } finally { 2 }) - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })] - mark({ 1 if (2 > 3) { return@ } }) - r(1) - mark(if (2 > 3) { return@ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L6) NEXT:[read (Unit), mark({ return@ })] - mark({ return@ }) + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })] + mark({ 1 if (2 > 3) { return@ } }) + r(1) + mark(if (2 > 3) { return@ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), mark({ return@ })] + mark({ return@ }) L7 [start finally]: - mark({ 2 }) - r(2) + mark({ 2 }) + r(2) L8 [finish finally]: - ret L4 NEXT:[] + ret L4 NEXT:[] - jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[] L6: read (Unit) PREV:[jf(L6)] L9: - jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L5 [onExceptionToFinallyBlock]: mark({ 2 }) PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - r(2) - jmp(error) NEXT:[] + r(2) + jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])] - r(2) + r(2) L4: NEXT:[] PREV:[ret L4, r(2)] error: @@ -307,48 +307,48 @@ fun t5() { } --------------------- L0: - + mark({ @ while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } } }) - mark(@ while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }) - mark(while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }) + mark(@ while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }) + mark(while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }) L2 [loop entry point]: L5 [condition entry point]: r(true) PREV:[mark(while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }), jmp(L2 [loop entry point])] L4 [body entry point]: - mark({ try { 1 if (2 > 3) { break @ } } finally { 2 } }) - mark(try { 1 if (2 > 3) { break @ } } finally { 2 }) - jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @ } })] - mark({ 1 if (2 > 3) { break @ } }) - r(1) - mark(if (2 > 3) { break @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ break @ })] - mark({ break @ }) + mark({ try { 1 if (2 > 3) { break @ } } finally { 2 } }) + mark(try { 1 if (2 > 3) { break @ } } finally { 2 }) + jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @ } })] + mark({ 1 if (2 > 3) { break @ } }) + r(1) + mark(if (2 > 3) { break @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ break @ })] + mark({ break @ }) L8 [start finally]: - mark({ 2 }) - r(2) + mark({ 2 }) + r(2) L9 [finish finally]: - jmp(L3 [loop exit point]) NEXT:[read (Unit)] + jmp(L3 [loop exit point]) NEXT:[read (Unit)] - jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L10: - jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L6 [onExceptionToFinallyBlock]: mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - r(2) - jmp(error) NEXT:[] + r(2) + jmp(error) NEXT:[] L11 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])] - r(2) - jmp(L2 [loop entry point]) NEXT:[r(true)] + r(2) + jmp(L2 [loop entry point]) NEXT:[r(true)] L3 [loop exit point]: read (Unit) PREV:[jmp(L3 [loop exit point])] L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -370,47 +370,47 @@ fun t6() { } --------------------- L0: - + mark({ try { @ while(true) { 1 if (2 > 3) { break @ } } 5 } finally { 2 } }) - mark(try { @ while(true) { 1 if (2 > 3) { break @ } } 5 } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 })] - mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 }) - mark(@ while(true) { 1 if (2 > 3) { break @ } }) - mark(while(true) { 1 if (2 > 3) { break @ } }) + mark(try { @ while(true) { 1 if (2 > 3) { break @ } } 5 } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 })] + mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 }) + mark(@ while(true) { 1 if (2 > 3) { break @ } }) + mark(while(true) { 1 if (2 > 3) { break @ } }) L3 [loop entry point]: L6 [condition entry point]: r(true) PREV:[mark(while(true) { 1 if (2 > 3) { break @ } }), jmp(L3 [loop entry point])] L5 [body entry point]: - mark({ 1 if (2 > 3) { break @ } }) - r(1) - mark(if (2 > 3) { break @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ break @ })] - mark({ break @ }) - jmp(L4 [loop exit point]) NEXT:[read (Unit)] + mark({ 1 if (2 > 3) { break @ } }) + r(1) + mark(if (2 > 3) { break @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ break @ })] + mark({ break @ }) + jmp(L4 [loop exit point]) NEXT:[read (Unit)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L8: - jmp(L3 [loop entry point]) NEXT:[r(true)] + jmp(L3 [loop entry point]) NEXT:[r(true)] L4 [loop exit point]: read (Unit) PREV:[jmp(L4 [loop exit point])] - r(5) - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + r(5) + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L10 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L11 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -431,46 +431,46 @@ fun t7() { } --------------------- L0: - + mark({ try { @ while(true) { 1 if (2 > 3) { break @ } } } finally { 2 } }) - mark(try { @ while(true) { 1 if (2 > 3) { break @ } } } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } })] - mark({ @ while(true) { 1 if (2 > 3) { break @ } } }) - mark(@ while(true) { 1 if (2 > 3) { break @ } }) - mark(while(true) { 1 if (2 > 3) { break @ } }) + mark(try { @ while(true) { 1 if (2 > 3) { break @ } } } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } })] + mark({ @ while(true) { 1 if (2 > 3) { break @ } } }) + mark(@ while(true) { 1 if (2 > 3) { break @ } }) + mark(while(true) { 1 if (2 > 3) { break @ } }) L3 [loop entry point]: L6 [condition entry point]: r(true) PREV:[mark(while(true) { 1 if (2 > 3) { break @ } }), jmp(L3 [loop entry point])] L5 [body entry point]: - mark({ 1 if (2 > 3) { break @ } }) - r(1) - mark(if (2 > 3) { break @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ break @ })] - mark({ break @ }) - jmp(L4 [loop exit point]) NEXT:[read (Unit)] + mark({ 1 if (2 > 3) { break @ } }) + r(1) + mark(if (2 > 3) { break @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ break @ })] + mark({ break @ }) + jmp(L4 [loop exit point]) NEXT:[read (Unit)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L8: - jmp(L3 [loop entry point]) NEXT:[r(true)] + jmp(L3 [loop entry point]) NEXT:[r(true)] L4 [loop exit point]: read (Unit) PREV:[jmp(L4 [loop exit point])] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L10 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L11 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -491,56 +491,56 @@ fun t8(a : Int) { } --------------------- L0: - - v(a : Int) - w(a) + + v(a : Int) + w(a) mark({ @ for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } } }) - mark(@ for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } }) - mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } }) - mark(1..a) - r(1) - r(a) - call(.., rangeTo) - v(i) - w(i) + mark(@ for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } }) + mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } }) + mark(1..a) + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L3: - jmp?(L2) NEXT:[read (Unit), mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })] + jmp?(L2) NEXT:[read (Unit), mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })] L4 [loop entry point]: L5 [body entry point]: mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } }) PREV:[jmp?(L2), jmp(L4 [loop entry point]), jmp?(L4 [loop entry point])] - mark(try { 1 if (2 > 3) { continue @ } } finally { 2 }) - jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @ } })] - mark({ 1 if (2 > 3) { continue @ } }) - r(1) - mark(if (2 > 3) { continue @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ continue @ })] - mark({ continue @ }) + mark(try { 1 if (2 > 3) { continue @ } } finally { 2 }) + jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @ } })] + mark({ 1 if (2 > 3) { continue @ } }) + r(1) + mark(if (2 > 3) { continue @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ continue @ })] + mark({ continue @ }) L8 [start finally]: - mark({ 2 }) - r(2) + mark({ 2 }) + r(2) L9 [finish finally]: - jmp(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })] + jmp(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })] - jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L10: - jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L6 [onExceptionToFinallyBlock]: mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - r(2) - jmp(error) NEXT:[] + r(2) + jmp(error) NEXT:[] L11 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])] - r(2) - jmp?(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } }), read (Unit)] + r(2) + jmp?(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } }), read (Unit)] L2: read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -562,55 +562,55 @@ fun t9(a : Int) { } --------------------- L0: - - v(a : Int) - w(a) + + v(a : Int) + w(a) mark({ try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 } finally { 2 } }) - mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 })] - mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 }) - mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } }) - mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } }) - mark(1..a) - r(1) - r(a) - call(.., rangeTo) - v(i) - w(i) + mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 })] + mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 }) + mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } }) + mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } }) + mark(1..a) + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L4: - jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })] + jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })] L5 [loop entry point]: L6 [body entry point]: mark({ 1 if (2 > 3) { continue @ } }) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] - r(1) - mark(if (2 > 3) { continue @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ continue @ })] - mark({ continue @ }) - jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })] + r(1) + mark(if (2 > 3) { continue @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ continue @ })] + mark({ continue @ }) + jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L8: - jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)] + jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)] L3: read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])] - r(5) - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + r(5) + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L10 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L11 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -631,54 +631,54 @@ fun t10(a : Int) { } --------------------- L0: - - v(a : Int) - w(a) + + v(a : Int) + w(a) mark({ try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } } finally { 2 } }) - mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } } finally { 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } })] - mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } }) - mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } }) - mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } }) - mark(1..a) - r(1) - r(a) - call(.., rangeTo) - v(i) - w(i) + mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } } finally { 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } })] + mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } }) + mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } }) + mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } }) + mark(1..a) + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L4: - jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })] + jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })] L5 [loop entry point]: L6 [body entry point]: mark({ 1 if (2 > 3) { continue @ } }) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] - r(1) - mark(if (2 > 3) { continue @ }) - mark(2 > 3) - r(2) - r(3) - call(>, compareTo) - jf(L7) NEXT:[read (Unit), mark({ continue @ })] - mark({ continue @ }) - jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })] + r(1) + mark(if (2 > 3) { continue @ }) + mark(2 > 3) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), mark({ continue @ })] + mark({ continue @ }) + jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: read (Unit) PREV:[jf(L7)] L8: - jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)] + jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)] L3: read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L10 [start finally]: mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) + r(2) L11 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])] - r(2) + r(2) L1: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -695,23 +695,23 @@ fun t11() { } --------------------- L0: - + mark({ try { return 1 } finally { return 2 } }) - mark(try { return 1 } finally { return 2 }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ return 2 }), mark({ return 1 })] - mark({ return 1 }) - r(1) + mark(try { return 1 } finally { return 2 }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ return 2 }), mark({ return 1 })] + mark({ return 1 }) + r(1) L3 [start finally]: - mark({ return 2 }) - r(2) - ret(*) L1 NEXT:[] + mark({ return 2 }) + r(2) + ret(*) L1 NEXT:[] L4 [finish finally]: - ret(*) L1 NEXT:[] PREV:[] - jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ return 2 })] PREV:[] L2 [onExceptionToFinallyBlock]: mark({ return 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) - ret(*) L1 NEXT:[] + r(2) + ret(*) L1 NEXT:[] - jmp(error) NEXT:[] PREV:[] L5 [skipFinallyToErrorBlock]: - mark({ return 2 }) PREV:[] @@ -735,26 +735,26 @@ fun t12() : Int { } --------------------- L0: - + mark({ try { return 1 } finally { doSmth(3) } }) - mark(try { return 1 } finally { doSmth(3) }) - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] - mark({ return 1 }) - r(1) + mark(try { return 1 } finally { doSmth(3) }) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] + mark({ return 1 }) + r(1) L3 [start finally]: - mark({ doSmth(3) }) - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark({ doSmth(3) }) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L4 [finish finally]: - ret(*) L1 NEXT:[] + ret(*) L1 NEXT:[] - jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[] L2 [onExceptionToFinallyBlock]: mark({ doSmth(3) }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) - jmp(error) NEXT:[] + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) + jmp(error) NEXT:[] L5 [skipFinallyToErrorBlock]: - mark({ doSmth(3) }) PREV:[] - mark(doSmth(3)) PREV:[] @@ -781,42 +781,42 @@ fun t13() : Int { } --------------------- L0: - + mark({ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } }) - mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) }) - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] - mark({ return 1 }) - r(1) + mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) }) + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] + mark({ return 1 }) + r(1) L4 [start finally]: - mark({ doSmth(3) }) - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark({ doSmth(3) }) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L5 [finish finally]: - ret(*) L1 NEXT:[] + ret(*) L1 NEXT:[] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] - w(e) - mark({ doSmth(2) }) - mark(doSmth(2)) - r(2) - call(doSmth, doSmth) - jmp(L6 [afterCatches]) + w(e) + mark({ doSmth(2) }) + mark(doSmth(2)) + r(2) + call(doSmth, doSmth) + jmp(L6 [afterCatches]) L6 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] L3 [onExceptionToFinallyBlock]: mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) - jmp(error) NEXT:[] + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: mark({ doSmth(3) }) PREV:[jmp(L7 [skipFinallyToErrorBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L1: NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: @@ -835,22 +835,22 @@ fun t14() : Int { } --------------------- L0: - + mark({ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } }) - mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) }) - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), mark({ return 1 })] - mark({ return 1 }) - r(1) - ret(*) L1 NEXT:[] + mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) }) + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), mark({ return 1 })] + mark({ return 1 }) + r(1) + ret(*) L1 NEXT:[] - jmp(L3 [afterCatches]) NEXT:[] PREV:[] L2 [onException]: v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] - w(e) - mark({ doSmth(2) }) - mark(doSmth(2)) - r(2) - call(doSmth, doSmth) - jmp(L3 [afterCatches]) + w(e) + mark({ doSmth(2) }) + mark(doSmth(2)) + r(2) + call(doSmth, doSmth) + jmp(L3 [afterCatches]) L1: L3 [afterCatches]: NEXT:[] PREV:[ret(*) L1, jmp(L3 [afterCatches])] @@ -873,40 +873,40 @@ fun t15() : Int { } --------------------- L0: - + mark({ try { return 1 } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } }) - mark(try { return 1 } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) }) - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] - mark({ return 1 }) - r(1) + mark(try { return 1 } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) }) + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })] + mark({ return 1 }) + r(1) L4 [start finally]: - mark({ doSmth(3) }) - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark({ doSmth(3) }) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L5 [finish finally]: - ret(*) L1 NEXT:[] + ret(*) L1 NEXT:[] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] - w(e) - mark({ return 2 }) - r(2) - mark({ doSmth(3) }) - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) - ret(*) L1 NEXT:[] + w(e) + mark({ return 2 }) + r(2) + mark({ doSmth(3) }) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) + ret(*) L1 NEXT:[] - jmp(L6 [afterCatches]) PREV:[] L6 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[] L3 [onExceptionToFinallyBlock]: mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) - jmp(error) NEXT:[] + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: - mark({ doSmth(3) }) PREV:[] - mark(doSmth(3)) PREV:[] @@ -933,42 +933,42 @@ fun t16() : Int { } --------------------- L0: - + mark({ try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } }) - mark(try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) }) - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ doSmth(1) })] - mark({ doSmth(1) }) - mark(doSmth(1)) - r(1) - call(doSmth, doSmth) - jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] + mark(try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) }) + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ doSmth(1) })] + mark({ doSmth(1) }) + mark(doSmth(1)) + r(1) + call(doSmth, doSmth) + jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] L2 [onException]: v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] - w(e) - mark({ return 2 }) - r(2) + w(e) + mark({ return 2 }) + r(2) L5 [start finally]: - mark({ doSmth(3) }) - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark({ doSmth(3) }) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L6 [finish finally]: - ret(*) L1 NEXT:[] + ret(*) L1 NEXT:[] - jmp(L4 [afterCatches]) PREV:[] L4 [afterCatches]: jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) - jmp(error) NEXT:[] + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: mark({ doSmth(3) }) PREV:[jmp(L7 [skipFinallyToErrorBlock])] - mark(doSmth(3)) - r(3) - call(doSmth, doSmth) + mark(doSmth(3)) + r(3) + call(doSmth, doSmth) L1: NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: @@ -981,13 +981,13 @@ fun doSmth(i: Int) { } --------------------- L0: - - v(i: Int) - w(i) - mark({ }) + + v(i: Int) + w(i) + mark({ }) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/FinallyTestCopy.instructions b/compiler/testData/cfg/FinallyTestCopy.instructions index b43926dfec1..15891186723 100644 --- a/compiler/testData/cfg/FinallyTestCopy.instructions +++ b/compiler/testData/cfg/FinallyTestCopy.instructions @@ -2,11 +2,11 @@ fun doSmth() {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -16,11 +16,11 @@ sink: fun doSmth1() {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -30,11 +30,11 @@ sink: fun doSmth2() {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -44,11 +44,11 @@ sink: fun cond() {} --------------------- L0: - - mark({}) + + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -71,43 +71,43 @@ fun testCopy1() : Int { } --------------------- L0: - + mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } }) - mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 }) - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ return 1 }), mark({ doSmth() })] - mark({ doSmth() }) - mark(doSmth()) - call(doSmth, doSmth) - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] + mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 }) + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] + 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]: jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) - w(e) - mark({ doSmth1() }) - mark(doSmth1()) - call(doSmth1, doSmth1) - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] + v(e: NullPointerException) + w(e) + mark({ doSmth1() }) + mark(doSmth1()) + call(doSmth1, doSmth1) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L5 [catch 0]: v(e: Exception) PREV:[jmp?(L5 [catch 0])] - w(e) - mark({ doSmth2() }) - mark(doSmth2()) - call(doSmth2, doSmth2) - jmp(L4 [afterCatches]) + w(e) + mark({ doSmth2() }) + mark(doSmth2()) + call(doSmth2, doSmth2) + jmp(L4 [afterCatches]) L4 [afterCatches]: jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ return 1 })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: mark({ return 1 }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(1) - ret(*) L1 NEXT:[] + r(1) + ret(*) L1 NEXT:[] L8 [finish finally]: - jmp(error) NEXT:[] PREV:[] L6 [skipFinallyToErrorBlock]: mark({ return 1 }) PREV:[jmp(L6 [skipFinallyToErrorBlock])] - r(1) - ret(*) L1 + r(1) + ret(*) L1 L1: NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: @@ -135,48 +135,48 @@ fun testCopy2() { } --------------------- L0: - + 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 } }) + mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } }) L2 [loop entry point]: L5 [condition 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])] - 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 } })] + 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]: - mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } }) - mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue }) - jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] - 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])] + mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } }) + mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue }) + jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] + 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]: jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])] - v(e: NullPointerException) - w(e) - mark({ doSmth1() }) - mark(doSmth1()) - call(doSmth1, doSmth1) - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] + v(e: NullPointerException) + w(e) + mark({ doSmth1() }) + mark(doSmth1()) + call(doSmth1, doSmth1) + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] L9 [catch 0]: v(e: Exception) PREV:[jmp?(L9 [catch 0])] - w(e) - mark({ doSmth2() }) - mark(doSmth2()) - call(doSmth2, doSmth2) - jmp(L8 [afterCatches]) + w(e) + mark({ doSmth2() }) + mark(doSmth2()) + call(doSmth2, doSmth2) + jmp(L8 [afterCatches]) L8 [afterCatches]: jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ if (cond()) return else continue })] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])] L7 [onExceptionToFinallyBlock]: L11 [start finally]: mark({ if (cond()) return else continue }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])] - mark(if (cond()) return else continue) - mark(cond()) - call(cond, cond) - jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] - ret L1 NEXT:[] + mark(if (cond()) return else continue) + mark(cond()) + call(cond, cond) + jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] + ret L1 NEXT:[] - jmp(L13) NEXT:[jmp(error)] PREV:[] L12: jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[jf(L12)] @@ -185,11 +185,11 @@ L14 [finish finally]: - jmp(error) NEXT:[] PREV:[] L10 [skipFinallyToErrorBlock]: mark({ if (cond()) return else continue }) PREV:[jmp(L10 [skipFinallyToErrorBlock])] - mark(if (cond()) return else continue) - mark(cond()) - call(cond, cond) - jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] - ret L1 NEXT:[] + mark(if (cond()) return else continue) + mark(cond()) + call(cond, cond) + jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] + ret L1 NEXT:[] - 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:[] @@ -219,57 +219,57 @@ fun testCopy3() { } --------------------- L0: - + mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } }) - mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); }) - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ while (cond()); }), mark({ doSmth() })] - mark({ doSmth() }) - mark(doSmth()) - call(doSmth, doSmth) - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] + mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); }) + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] + 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]: jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) - w(e) - mark({ doSmth1() }) - mark(doSmth1()) - call(doSmth1, doSmth1) - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] + v(e: NullPointerException) + w(e) + mark({ doSmth1() }) + mark(doSmth1()) + call(doSmth1, doSmth1) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L5 [catch 0]: v(e: Exception) PREV:[jmp?(L5 [catch 0])] - w(e) - mark({ doSmth2() }) - mark(doSmth2()) - call(doSmth2, doSmth2) - jmp(L4 [afterCatches]) + w(e) + mark({ doSmth2() }) + mark(doSmth2()) + call(doSmth2, doSmth2) + jmp(L4 [afterCatches]) L4 [afterCatches]: jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ while (cond()); })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: mark({ while (cond()); }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - mark(while (cond())) + mark(while (cond())) L8 [loop entry point]: L11 [condition entry point]: mark(cond()) PREV:[mark(while (cond())), jmp(L8 [loop entry point])] - call(cond, cond) - 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]: - jmp(L8 [loop entry point]) NEXT:[mark(cond())] + jmp(L8 [loop entry point]) NEXT:[mark(cond())] L9 [loop exit point]: read (Unit) PREV:[jf(L9 [loop exit point])] L12 [finish finally]: - jmp(error) NEXT:[] + jmp(error) NEXT:[] L6 [skipFinallyToErrorBlock]: mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])] - mark(while (cond())) + mark(while (cond())) mark(cond()) PREV:[mark(while (cond())), jmp(copy L8 [loop entry 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())] + 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: - NEXT:[] + NEXT:[] error: PREV:[jmp(error)] sink: @@ -287,28 +287,28 @@ fun doTestCopy4(list: List?) : Int { } --------------------- L0: - - v(list: List?) - w(list) + + v(list: List?) + w(list) mark({ try { doSmth() } finally { if(list != null) { } } }) - mark(try { doSmth() } finally { if(list != null) { } }) - 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) { } })] + mark(try { doSmth() } finally { if(list != null) { } }) + 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]: L4 [start finally]: mark({ if(list != null) { } }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - mark(if(list != null) { }) - mark(list != null) - r(list) - r(null) - call(list != null, equals) - jf(L5) NEXT:[read (Unit), mark({ })] - mark({ }) - read (Unit) - jmp(L6) NEXT:[jmp(error)] + mark(if(list != null) { }) + mark(list != null) + r(list) + r(null) + call(list != null, equals) + jf(L5) NEXT:[read (Unit), mark({ })] + mark({ }) + read (Unit) + jmp(L6) NEXT:[jmp(error)] L5: read (Unit) PREV:[jf(L5)] L6: @@ -316,15 +316,15 @@ L7 [finish finally]: jmp(error) NEXT:[] PREV:[jmp(L6), read (Unit)] L3 [skipFinallyToErrorBlock]: mark({ if(list != null) { } }) PREV:[jmp(L3 [skipFinallyToErrorBlock])] - mark(if(list != null) { }) - mark(list != null) - r(list) - r(null) - call(list != null, equals) - jf(copy L5) NEXT:[read (Unit), mark({ })] - mark({ }) - read (Unit) - jmp(copy L6) NEXT:[] + mark(if(list != null) { }) + mark(list != null) + r(list) + r(null) + call(list != null, equals) + jf(copy L5) NEXT:[read (Unit), mark({ })] + mark({ }) + read (Unit) + jmp(copy L6) NEXT:[] read (Unit) PREV:[jf(copy L5)] L1: NEXT:[] PREV:[jmp(copy L6), read (Unit)] diff --git a/compiler/testData/cfg/For.instructions b/compiler/testData/cfg/For.instructions index 79732fcbce7..be2d7a23d21 100644 --- a/compiler/testData/cfg/For.instructions +++ b/compiler/testData/cfg/For.instructions @@ -6,28 +6,28 @@ fun t1() { } --------------------- L0: - + mark({ for (i in 1..2) { doSmth(i) } }) - mark(for (i in 1..2) { doSmth(i) }) - mark(1..2) - r(1) - r(2) - call(.., rangeTo) - v(i) - w(i) + mark(for (i in 1..2) { doSmth(i) }) + mark(1..2) + r(1) + r(2) + call(.., rangeTo) + v(i) + w(i) L3: - jmp?(L2) NEXT:[read (Unit), mark({ doSmth(i) })] + jmp?(L2) NEXT:[read (Unit), mark({ doSmth(i) })] L4 [loop entry point]: L5 [body entry point]: mark({ doSmth(i) }) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] - mark(doSmth(i)) - r(i) - call(doSmth, doSmth) - jmp?(L4 [loop entry point]) NEXT:[mark({ doSmth(i) }), read (Unit)] + mark(doSmth(i)) + r(i) + call(doSmth, doSmth) + jmp?(L4 [loop entry point]) NEXT:[mark({ doSmth(i) }), read (Unit)] L2: read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -37,13 +37,13 @@ sink: fun doSmth(i: Int) {} --------------------- L0: - - v(i: Int) - w(i) - mark({}) + + v(i: Int) + w(i) + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/If.instructions b/compiler/testData/cfg/If.instructions index 1e4e23f2750..9a5f76422b9 100644 --- a/compiler/testData/cfg/If.instructions +++ b/compiler/testData/cfg/If.instructions @@ -17,45 +17,45 @@ fun t1(b: Boolean) { } --------------------- L0: - - v(b: Boolean) - w(b) + + v(b: Boolean) + w(b) mark({ var u: String if (b) { u = "s" } doSmth(u) var r: String if (b) { r = "s" } else { r = "t" } doSmth(r) }) - v(var u: String) - mark(if (b) { u = "s" }) - r(b) - jf(L2) NEXT:[read (Unit), mark({ u = "s" })] - mark({ u = "s" }) - mark("s") - r("s") - w(u) - jmp(L3) NEXT:[mark(doSmth(u))] + v(var u: String) + mark(if (b) { u = "s" }) + r(b) + jf(L2) NEXT:[read (Unit), mark({ u = "s" })] + mark({ u = "s" }) + mark("s") + r("s") + w(u) + jmp(L3) NEXT:[mark(doSmth(u))] L2: read (Unit) PREV:[jf(L2)] L3: mark(doSmth(u)) PREV:[jmp(L3), read (Unit)] - r(u) - call(doSmth, doSmth) - v(var r: String) - mark(if (b) { r = "s" } else { r = "t" }) - r(b) - jf(L4) NEXT:[mark({ r = "t" }), mark({ r = "s" })] - mark({ r = "s" }) - mark("s") - r("s") - w(r) - jmp(L5) NEXT:[mark(doSmth(r))] + r(u) + call(doSmth, doSmth) + v(var r: String) + mark(if (b) { r = "s" } else { r = "t" }) + r(b) + jf(L4) NEXT:[mark({ r = "t" }), mark({ r = "s" })] + mark({ r = "s" }) + mark("s") + r("s") + w(r) + jmp(L5) NEXT:[mark(doSmth(r))] L4: mark({ r = "t" }) PREV:[jf(L4)] - mark("t") - r("t") - w(r) + mark("t") + r("t") + w(r) L5: mark(doSmth(r)) PREV:[jmp(L5), w(r)] - r(r) - call(doSmth, doSmth) + r(r) + call(doSmth, doSmth) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -74,31 +74,31 @@ fun t2(b: Boolean) { } --------------------- L0: - - v(b: Boolean) - w(b) + + v(b: Boolean) + w(b) mark({ val i = 3 if (b) { return; } doSmth(i) if (i is Int) { return; } }) - v(val i = 3) - r(3) - w(i) - mark(if (b) { return; }) - r(b) - jf(L2) NEXT:[read (Unit), mark({ return; })] - mark({ return; }) - ret L1 NEXT:[] + v(val i = 3) + r(3) + w(i) + mark(if (b) { return; }) + r(b) + jf(L2) NEXT:[read (Unit), mark({ return; })] + mark({ return; }) + ret L1 NEXT:[] - jmp(L3) NEXT:[mark(doSmth(i))] PREV:[] L2: read (Unit) PREV:[jf(L2)] L3: - mark(doSmth(i)) - r(i) - call(doSmth, doSmth) - mark(if (i is Int) { return; }) - mark(i is Int) - r(i) - jf(L4) NEXT:[read (Unit), mark({ return; })] - mark({ return; }) - ret L1 NEXT:[] + mark(doSmth(i)) + r(i) + call(doSmth, doSmth) + mark(if (i is Int) { return; }) + mark(i is Int) + r(i) + jf(L4) NEXT:[read (Unit), mark({ return; })] + mark({ return; }) + ret L1 NEXT:[] - jmp(L5) NEXT:[] PREV:[] L4: read (Unit) PREV:[jf(L4)] @@ -114,13 +114,13 @@ sink: fun doSmth(s: String) {} --------------------- L0: - + v(s: String) - w(s) - mark({}) - read (Unit) + w(s) + mark({}) + read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/LazyBooleans.instructions b/compiler/testData/cfg/LazyBooleans.instructions index f937676407e..da8836064b8 100644 --- a/compiler/testData/cfg/LazyBooleans.instructions +++ b/compiler/testData/cfg/LazyBooleans.instructions @@ -18,67 +18,67 @@ fun lazyBooleans(a : Boolean, b : Boolean) : Unit { } --------------------- L0: - - v(a : Boolean) - w(a) - v(b : Boolean) - w(b) + + v(a : Boolean) + w(a) + v(b : Boolean) + w(b) 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 }) - mark(if (a) { 1 } else { 2 }) - r(a) - jf(L2) NEXT:[mark({ 2 }), mark({ 1 })] - mark({ 1 }) - r(1) - jmp(L3) NEXT:[r(3)] + mark(if (a) { 1 } else { 2 }) + r(a) + jf(L2) NEXT:[mark({ 2 }), mark({ 1 })] + mark({ 1 }) + r(1) + jmp(L3) NEXT:[r(3)] L2: mark({ 2 }) PREV:[jf(L2)] - r(2) + r(2) L3: r(3) PREV:[jmp(L3), r(2)] - mark(if (a && b) 5 else 6) - r(a) - jf(L4) NEXT:[jf(L5), r(b)] - r(b) + mark(if (a && b) 5 else 6) + r(a) + jf(L4) NEXT:[jf(L5), r(b)] + r(b) L4: jf(L5) NEXT:[r(6), r(5)] PREV:[jf(L4), r(b)] - r(5) - jmp(L6) NEXT:[r(7)] + r(5) + jmp(L6) NEXT:[r(7)] L5: r(6) PREV:[jf(L5)] L6: r(7) PREV:[jmp(L6), r(6)] - mark(if (a || b) 8 else 9) - r(a) - jt(L7) NEXT:[r(b), jf(L8)] - r(b) + mark(if (a || b) 8 else 9) + r(a) + jt(L7) NEXT:[r(b), jf(L8)] + r(b) L7: jf(L8) NEXT:[r(9), r(8)] PREV:[jt(L7), r(b)] - r(8) - jmp(L9) NEXT:[r(10)] + r(8) + jmp(L9) NEXT:[r(10)] L8: r(9) PREV:[jf(L8)] L9: r(10) PREV:[jmp(L9), r(9)] - mark(if (a) 11) - r(a) - jf(L10) NEXT:[read (Unit), r(11)] - r(11) - jmp(L11) NEXT:[r(12)] + mark(if (a) 11) + r(a) + jf(L10) NEXT:[read (Unit), r(11)] + r(11) + jmp(L11) NEXT:[r(12)] L10: read (Unit) PREV:[jf(L10)] L11: r(12) PREV:[jmp(L11), read (Unit)] - mark(if (a) else 13) - r(a) - jf(L12) NEXT:[r(13), read (Unit)] - read (Unit) - jmp(L13) NEXT:[r(14)] + mark(if (a) else 13) + r(a) + jf(L12) NEXT:[r(13), read (Unit)] + read (Unit) + jmp(L13) NEXT:[r(14)] L12: r(13) PREV:[jf(L12)] L13: r(14) PREV:[jmp(L13), r(13)] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/LocalDeclarations.instructions b/compiler/testData/cfg/LocalDeclarations.instructions index b8f5863ca76..e42e1a00f60 100644 --- a/compiler/testData/cfg/LocalDeclarations.instructions +++ b/compiler/testData/cfg/LocalDeclarations.instructions @@ -18,12 +18,12 @@ class C() { } --------------------- L0: - + v(val a: Int = 1) - r(1) - w(a) + r(1) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -33,13 +33,13 @@ sink: fun doSmth(i: Int) {} --------------------- L0: - - v(i: Int) - w(i) - mark({}) + + v(i: Int) + w(i) + mark({}) read (Unit) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -56,18 +56,18 @@ fun test1() { } --------------------- L0: - + mark({ val a = object { val x : Int { $x = 1 } } }) - v(val a = object { val x : Int { $x = 1 } }) - mark(object { val x : Int { $x = 1 } }) - v(val x : Int) - mark({ $x = 1 }) - r(1) - w($x) - r(object { val x : Int { $x = 1 } }) - w(a) + v(val a = object { val x : Int { $x = 1 } }) + mark(object { val x : Int { $x = 1 } }) + v(val x : Int) + mark({ $x = 1 }) + r(1) + w($x) + r(object { val x : Int { $x = 1 } }) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -82,13 +82,13 @@ object O { } --------------------- L0: - - v(val x : Int) + + v(val x : Int) mark({ $x = 1 }) - r(1) - w($x) + r(1) + w($x) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -103,20 +103,20 @@ fun test2() { } --------------------- L0: - + mark({ val b = 1 val a = object { val x = b } }) - v(val b = 1) - r(1) - w(b) - v(val a = object { val x = b }) - mark(object { val x = b }) - v(val x = b) - r(b) - w(x) - r(object { val x = b }) - w(a) + v(val b = 1) + r(1) + w(b) + v(val a = object { val x = b }) + mark(object { val x = b }) + v(val x = b) + r(b) + w(x) + r(object { val x = b }) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -133,29 +133,29 @@ fun test3() { } --------------------- L0: - + mark({ val a = object { val y : Int fun inner_bar() { y = 10 } } }) - v(val a = object { val y : Int fun inner_bar() { y = 10 } }) - mark(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 } }) + mark(object { val y : Int fun inner_bar() { y = 10 } }) + 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:[] + d(fun inner_bar() { y = 10 }) NEXT:[] L2: r(object { val y : Int fun inner_bar() { y = 10 } }) PREV:[jmp?(L2)] - w(a) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d(fun inner_bar() { y = 10 })] L3: - + mark({ y = 10 }) - r(10) - w(y) + r(10) + w(y) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -167,12 +167,12 @@ fun inner_bar() { } --------------------- L3: - + mark({ y = 10 }) - r(10) - w(y) + r(10) + w(y) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -193,33 +193,33 @@ fun test4() { } --------------------- L0: - + mark({ val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } }) - v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) - mark(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) - v(val x : Int) - v(val y : Int) - mark({ $x = 1 }) - r(1) - w($x) + v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) + mark(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) + v(val x : Int) + v(val y : Int) + mark({ $x = 1 }) + 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:[] + d(fun ggg() { y = 10 }) NEXT:[] L2: r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) PREV:[jmp?(L2)] - w(a) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d(fun ggg() { y = 10 })] L3: - + mark({ y = 10 }) - r(10) - w(y) + r(10) + w(y) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -231,12 +231,12 @@ fun ggg() { } --------------------- L3: - + mark({ y = 10 }) - r(10) - w(y) + r(10) + w(y) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -259,48 +259,48 @@ fun test5() { } --------------------- L0: - + mark({ val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } }) - v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) - mark(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) - v(var x = 1) - r(1) - w(x) - mark({ $x = 2 }) - r(2) - w($x) - jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })] - d(fun foo() { x = 3 }) NEXT:[] + v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) + mark(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) + v(var x = 1) + r(1) + w(x) + mark({ $x = 2 }) + r(2) + w($x) + jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })] + d(fun foo() { x = 3 }) NEXT:[] 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:[] + d(fun bar() { x = 4 }) NEXT:[] L5: r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) PREV:[jmp?(L5)] - w(a) + w(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d(fun foo() { x = 3 }), d(fun bar() { x = 4 })] L3: - + mark({ x = 3 }) - r(3) - w(x) + r(3) + w(x) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, ] L6: - + mark({ x = 4 }) - r(4) - w(x) + r(4) + w(x) L7: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -312,12 +312,12 @@ fun foo() { } --------------------- L3: - + mark({ x = 3 }) - r(3) - w(x) + r(3) + w(x) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -329,12 +329,12 @@ fun bar() { } --------------------- L6: - + mark({ x = 4 }) - r(4) - w(x) + r(4) + w(x) L7: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/MultiDecl.instructions b/compiler/testData/cfg/MultiDecl.instructions index 2b38aee15d2..b67f1ce172e 100644 --- a/compiler/testData/cfg/MultiDecl.instructions +++ b/compiler/testData/cfg/MultiDecl.instructions @@ -20,22 +20,22 @@ fun test(c: C) { } --------------------- L0: - - v(c: C) - w(c) + + v(c: C) + w(c) mark({ val (a, b) = c val d = 1 }) - r(c) - v(a) - call(a, component1) - w(a) - v(b) - call(b, component2) - w(b) - v(val d = 1) - r(1) - w(d) + r(c) + v(a) + call(a, component1) + w(a) + v(b) + call(b, component2) + w(b) + v(val d = 1) + r(1) + w(d) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/ObjectExpression.instructions b/compiler/testData/cfg/ObjectExpression.instructions index bfbe0e9b06c..1e08335dd15 100644 --- a/compiler/testData/cfg/ObjectExpression.instructions +++ b/compiler/testData/cfg/ObjectExpression.instructions @@ -18,10 +18,10 @@ class B : A { } --------------------- L0: - + unsupported(DELEGATOR_SUPER_CLASS : A) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -34,22 +34,22 @@ fun foo(b: B) : Int { } --------------------- L0: - - v(b: B) - w(b) + + v(b: B) + w(b) mark({ val o = object : A by b {} return o.foo() }) - v(val o = object : A by b {}) - mark(object : A by b {}) - r(b) - r(object : A by b {}) - w(o) - mark(o.foo()) - mark(foo()) - r(o) - call(foo, foo) - ret(*) L1 + v(val o = object : A by b {}) + mark(object : A by b {}) + r(b) + r(object : A by b {}) + w(o) + mark(o.foo()) + mark(foo()) + r(o) + call(foo, foo) + ret(*) L1 L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions index 63a7ce6b096..d29ea67abdf 100644 --- a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions +++ b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions @@ -6,24 +6,24 @@ fun main() { } --------------------- L0: - + mark({ while(1 > 0) { 2 } }) - mark(while(1 > 0) { 2 }) + mark(while(1 > 0) { 2 }) L2 [loop entry point]: L5 [condition entry point]: mark(1 > 0) PREV:[mark(while(1 > 0) { 2 }), jmp(L2 [loop entry point])] - r(1) - r(0) - call(>, compareTo) - jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ 2 })] + r(1) + r(0) + call(>, compareTo) + jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ 2 })] L4 [body entry point]: - mark({ 2 }) - r(2) - jmp(L2 [loop entry point]) NEXT:[mark(1 > 0)] + mark({ 2 }) + r(2) + jmp(L2 [loop entry point]) NEXT:[mark(1 > 0)] L3 [loop exit point]: read (Unit) PREV:[jf(L3 [loop exit point])] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -36,13 +36,13 @@ fun dowhile() { } --------------------- L0: - + mark({ do {return} while(1 > 0) }) - mark(do {return} while(1 > 0)) + mark(do {return} while(1 > 0)) L2 [loop entry point]: L4 [body entry point]: - mark({return}) - ret L1 NEXT:[] + mark({return}) + ret L1 NEXT:[] L5 [condition entry point]: - mark(1 > 0) PREV:[] - r(1) PREV:[] diff --git a/compiler/testData/cfg/ReturnFromExpression.instructions b/compiler/testData/cfg/ReturnFromExpression.instructions index 0099234e922..a78cbf012d9 100644 --- a/compiler/testData/cfg/ReturnFromExpression.instructions +++ b/compiler/testData/cfg/ReturnFromExpression.instructions @@ -4,13 +4,13 @@ fun blockAndAndMismatch() : Boolean { } --------------------- L0: - + mark({ false || (return false) }) - r(false) + r(false) jt(L2) NEXT:[mark((return false)), r(false || (return false))] - mark((return false)) - r(false) - ret(*) L1 NEXT:[] + mark((return false)) + r(false) + ret(*) L1 NEXT:[] L2: r(false || (return false)) PREV:[jt(L2)] L1: diff --git a/compiler/testData/cfg/ShortFunction.instructions b/compiler/testData/cfg/ShortFunction.instructions index 10b57ea55e6..e820bfccfa2 100644 --- a/compiler/testData/cfg/ShortFunction.instructions +++ b/compiler/testData/cfg/ShortFunction.instructions @@ -3,7 +3,7 @@ fun short() = 1 --------------------- L0: - r(1) + r(1) L1: NEXT:[] error: diff --git a/compiler/testData/cfg/arrayAccessExpression.instructions b/compiler/testData/cfg/arrayAccessExpression.instructions index 40eb60c4fbc..17da1da28a4 100644 --- a/compiler/testData/cfg/arrayAccessExpression.instructions +++ b/compiler/testData/cfg/arrayAccessExpression.instructions @@ -18,19 +18,19 @@ fun test(ab: Ab) { } --------------------- L0: - - v(ab: Ab) - w(ab) - mark({ ab.getArray()[1] }) - mark(ab.getArray()[1]) - mark(ab.getArray()) - mark(getArray()) - r(ab) - call(getArray, getArray) - r(1) + + v(ab: Ab) + w(ab) + mark({ ab.getArray()[1] }) + mark(ab.getArray()[1]) + mark(ab.getArray()) + mark(getArray()) + r(ab) + call(getArray, getArray) + r(1) call(ab.getArray()[1], get) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/arraySet.instructions b/compiler/testData/cfg/arraySet.instructions index 459a4912544..9c193ed88d4 100644 --- a/compiler/testData/cfg/arraySet.instructions +++ b/compiler/testData/cfg/arraySet.instructions @@ -4,17 +4,17 @@ fun foo(a: Array) { } --------------------- L0: - - v(a: Array) - w(a) + + v(a: Array) + w(a) mark({ a[1] = 2 }) - mark(a[1]) - r(a) - r(1) - r(2) - call(a[1], set) + mark(a[1]) + r(a) + r(1) + r(2) + call(a[1], set) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/arraySetPlusAssign.instructions b/compiler/testData/cfg/arraySetPlusAssign.instructions index aeb21075064..04367b2808f 100644 --- a/compiler/testData/cfg/arraySetPlusAssign.instructions +++ b/compiler/testData/cfg/arraySetPlusAssign.instructions @@ -4,23 +4,23 @@ fun foo(a: Array) { } --------------------- L0: - - v(a: Array) - w(a) + + v(a: Array) + w(a) mark({ a[0] += 1 }) - mark(a[0] += 1) - mark(a[0]) - r(a) - r(0) - call(a[0], get) - r(1) - call(+=, plus) - r(a) - r(0) - r(1) - call(a[0], set) + mark(a[0] += 1) + mark(a[0]) + r(a) + r(0) + call(a[0], get) + r(1) + call(+=, plus) + r(a) + r(0) + r(1) + call(a[0], set) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/assignmentToThis.instructions b/compiler/testData/cfg/assignmentToThis.instructions index f8d83fda136..27b97620025 100644 --- a/compiler/testData/cfg/assignmentToThis.instructions +++ b/compiler/testData/cfg/assignmentToThis.instructions @@ -4,14 +4,14 @@ fun Int.bar(c: C) { } --------------------- L0: - - v(c: C) - w(c) - mark({ this = c }) - r(c) + + v(c: C) + w(c) + mark({ this = c }) + r(c) unsupported(BINARY_EXPRESSION : this = c) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/backingFieldAccess.instructions b/compiler/testData/cfg/backingFieldAccess.instructions index 92b380a0c75..6059976c1a6 100644 --- a/compiler/testData/cfg/backingFieldAccess.instructions +++ b/compiler/testData/cfg/backingFieldAccess.instructions @@ -9,22 +9,22 @@ class C { } --------------------- L0: - + v(val a: Int get() = 1) jmp?(L2) NEXT:[mark({ $a }), d(get() = 1)] - d(get() = 1) NEXT:[] + d(get() = 1) NEXT:[] L2: mark({ $a }) PREV:[jmp?(L2)] - r($a) + r($a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d(get() = 1)] L3: - r(1) + r(1) L4: NEXT:[] error: @@ -37,7 +37,7 @@ get() = 1 --------------------- L3: - r(1) + r(1) L4: NEXT:[] error: diff --git a/compiler/testData/cfg/deadCode/DeadCode.instructions b/compiler/testData/cfg/deadCode/DeadCode.instructions index 4d8f362750b..5dd0f437c37 100644 --- a/compiler/testData/cfg/deadCode/DeadCode.instructions +++ b/compiler/testData/cfg/deadCode/DeadCode.instructions @@ -5,12 +5,12 @@ fun test() { } --------------------- L0: - + mark({ throw Exception() test() }) - mark(throw Exception()) - mark(Exception()) - call(Exception, ) - throw (throw Exception()) NEXT:[] + mark(throw Exception()) + mark(Exception()) + call(Exception, ) + throw (throw Exception()) NEXT:[] - mark(test()) PREV:[] - call(test, test) PREV:[] L1: diff --git a/compiler/testData/cfg/deadCode/returnInElvis.instructions b/compiler/testData/cfg/deadCode/returnInElvis.instructions index af8ad57021a..2c55d538e82 100644 --- a/compiler/testData/cfg/deadCode/returnInElvis.instructions +++ b/compiler/testData/cfg/deadCode/returnInElvis.instructions @@ -4,9 +4,9 @@ fun foo() { } --------------------- L0: - + mark({ return ?: null }) - ret L1 NEXT:[] + ret L1 NEXT:[] - jt(L2) NEXT:[r(null), ] PREV:[] - r(null) PREV:[] L1: diff --git a/compiler/testData/cfg/deadCode/stringTemplate.instructions b/compiler/testData/cfg/deadCode/stringTemplate.instructions index 1a3fd9a4a04..6cffdc156cc 100644 --- a/compiler/testData/cfg/deadCode/stringTemplate.instructions +++ b/compiler/testData/cfg/deadCode/stringTemplate.instructions @@ -4,13 +4,13 @@ fun test() { } --------------------- L0: - + mark({ "${throw Exception()} ${1}" }) - mark("${throw Exception()} ${1}") - mark(throw Exception()) - mark(Exception()) - call(Exception, ) - throw (throw Exception()) NEXT:[] + mark("${throw Exception()} ${1}") + mark(throw Exception()) + mark(Exception()) + call(Exception, ) + throw (throw Exception()) NEXT:[] - r(1) PREV:[] - r("${throw Exception()} ${1}") PREV:[] L1: diff --git a/compiler/testData/cfg/equals.instructions b/compiler/testData/cfg/equals.instructions index bcdc48ad7c0..22234541ce6 100644 --- a/compiler/testData/cfg/equals.instructions +++ b/compiler/testData/cfg/equals.instructions @@ -5,21 +5,21 @@ fun foo(a: Int, b: Int) { } --------------------- L0: - - v(a: Int) - w(a) - v(b: Int) - w(b) + + v(a: Int) + w(a) + v(b: Int) + w(b) mark({ if (a == b) { } }) - mark(if (a == b) { }) - mark(a == b) - r(a) - r(b) - call(a == b, equals) - jf(L2) NEXT:[read (Unit), mark({ })] - mark({ }) - read (Unit) - jmp(L3) NEXT:[] + mark(if (a == b) { }) + mark(a == b) + r(a) + r(b) + call(a == b, equals) + jf(L2) NEXT:[read (Unit), mark({ })] + mark({ }) + read (Unit) + jmp(L3) NEXT:[] L2: read (Unit) PREV:[jf(L2)] L1: diff --git a/compiler/testData/cfg/expressionAsFunction.instructions b/compiler/testData/cfg/expressionAsFunction.instructions index dd09b4ef22f..bfd302189d1 100644 --- a/compiler/testData/cfg/expressionAsFunction.instructions +++ b/compiler/testData/cfg/expressionAsFunction.instructions @@ -4,16 +4,16 @@ fun invoke(f: () -> Unit) { } --------------------- L0: - - v(f: () -> Unit) - w(f) - mark({ (f)() }) - mark((f)()) - mark((f)) - r(f) + + v(f: () -> Unit) + w(f) + mark({ (f)() }) + mark((f)()) + mark((f)) + r(f) call((f), ) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/incrementAtTheEnd.instructions b/compiler/testData/cfg/incrementAtTheEnd.instructions index cf8740a3f97..080c35b051e 100644 --- a/compiler/testData/cfg/incrementAtTheEnd.instructions +++ b/compiler/testData/cfg/incrementAtTheEnd.instructions @@ -5,17 +5,17 @@ fun foo() { } --------------------- L0: - + mark({ var i = 1 i++ }) - v(var i = 1) - r(1) - w(i) - mark(i++) - r(i) - call(++, inc) - w(i) + v(var i = 1) + r(1) + w(i) + mark(i++) + r(i) + call(++, inc) + w(i) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/invoke.instructions b/compiler/testData/cfg/invoke.instructions index f5ac0267840..ad71705964e 100644 --- a/compiler/testData/cfg/invoke.instructions +++ b/compiler/testData/cfg/invoke.instructions @@ -4,15 +4,15 @@ fun foo(f: () -> Unit) { } --------------------- L0: - + v(f: () -> Unit) - w(f) - mark({ f() }) - mark(f()) - r(f) - call(f, invoke) + w(f) + mark({ f() }) + mark(f()) + r(f) + call(f, invoke) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/multiDeclarationWithError.instructions b/compiler/testData/cfg/multiDeclarationWithError.instructions index 29e073a7b17..b29bc7d469c 100644 --- a/compiler/testData/cfg/multiDeclarationWithError.instructions +++ b/compiler/testData/cfg/multiDeclarationWithError.instructions @@ -5,18 +5,18 @@ fun foo(x: Int) { } --------------------- L0: - - v(x: Int) - w(x) + + v(x: Int) + w(x) mark({ val (a, b) = x a }) - r(x) - v(a) - w(a) - v(b) - w(b) - r(a) + r(x) + v(a) + w(a) + v(b) + w(b) + r(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/notEqual.instructions b/compiler/testData/cfg/notEqual.instructions index 571dbbf58c2..b15b8cdca9e 100644 --- a/compiler/testData/cfg/notEqual.instructions +++ b/compiler/testData/cfg/notEqual.instructions @@ -4,21 +4,21 @@ fun neq(a: Int, b: Int) { } --------------------- L0: - - v(a: Int) - w(a) - v(b: Int) - w(b) + + v(a: Int) + w(a) + v(b: Int) + w(b) mark({ if (a != b) {} }) - mark(if (a != b) {}) - mark(a != b) - r(a) - r(b) - call(a != b, equals) - jf(L2) NEXT:[read (Unit), mark({})] - mark({}) - read (Unit) - jmp(L3) NEXT:[] + mark(if (a != b) {}) + mark(a != b) + r(a) + r(b) + call(a != b, equals) + jf(L2) NEXT:[read (Unit), mark({})] + mark({}) + read (Unit) + jmp(L3) NEXT:[] L2: read (Unit) PREV:[jf(L2)] L1: diff --git a/compiler/testData/cfg/propertySafeCall.instructions b/compiler/testData/cfg/propertySafeCall.instructions index 72533c5cab1..ba87073cdd5 100644 --- a/compiler/testData/cfg/propertySafeCall.instructions +++ b/compiler/testData/cfg/propertySafeCall.instructions @@ -4,15 +4,15 @@ fun test(s: String?) { } --------------------- L0: - - v(s: String?) - w(s) + + v(s: String?) + w(s) mark({ s?.length }) - mark(s?.length) - r(s) - r(length) + mark(s?.length) + r(s) + r(length) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/returnsInWhen.instructions b/compiler/testData/cfg/returnsInWhen.instructions index 6f213a558da..e5aeff8370e 100644 --- a/compiler/testData/cfg/returnsInWhen.instructions +++ b/compiler/testData/cfg/returnsInWhen.instructions @@ -6,17 +6,17 @@ fun illegalWhenBlock(a: Any): Any { } --------------------- L0: - - v(a: Any) - w(a) + + v(a: Any) + w(a) mark({ when(a) { is Int -> return a } }) - mark(when(a) { is Int -> return a }) - r(a) - mark(is Int -> return a) - jmp?(L4) NEXT:[, r(a)] + mark(when(a) { is Int -> return a }) + r(a) + mark(is Int -> return a) + jmp?(L4) NEXT:[, r(a)] L3: - r(a) - ret(*) L1 NEXT:[] + r(a) + ret(*) L1 NEXT:[] - jmp(L2) PREV:[] L1: L2: diff --git a/compiler/testData/cfg/thisExpression.instructions b/compiler/testData/cfg/thisExpression.instructions index af0f3d5448f..e7afb9d7dff 100644 --- a/compiler/testData/cfg/thisExpression.instructions +++ b/compiler/testData/cfg/thisExpression.instructions @@ -4,13 +4,13 @@ fun Function0.foo() { } --------------------- L0: - - mark({ this() }) - mark(this()) - r(this) + + mark({ this() }) + mark(this()) + r(this) call(this, ) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/typeParameter.instructions b/compiler/testData/cfg/typeParameter.instructions index e180ded48ce..baab291140d 100644 --- a/compiler/testData/cfg/typeParameter.instructions +++ b/compiler/testData/cfg/typeParameter.instructions @@ -4,11 +4,11 @@ fun foo() { } --------------------- L0: - - mark({ T }) + + mark({ T }) error(T, No resolved call) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/unresolved.instructions b/compiler/testData/cfg/unresolved.instructions index e06d6898ed7..349f0d13b7a 100644 --- a/compiler/testData/cfg/unresolved.instructions +++ b/compiler/testData/cfg/unresolved.instructions @@ -4,17 +4,17 @@ fun test(a: Any) { } --------------------- L0: - - v(a: Any) - w(a) - mark({ a.foo() }) - mark(a.foo()) - mark(foo()) + + v(a: Any) + w(a) + mark({ a.foo() }) + mark(a.foo()) + mark(foo()) error(foo, No resolved call) error(foo, No resolved call) - r(a) + r(a) L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/testData/cfg/unusedFunctionLiteral.instructions b/compiler/testData/cfg/unusedFunctionLiteral.instructions index c5bc2889d5f..719d5715e21 100644 --- a/compiler/testData/cfg/unusedFunctionLiteral.instructions +++ b/compiler/testData/cfg/unusedFunctionLiteral.instructions @@ -4,25 +4,25 @@ fun foo() { } --------------------- L0: - + mark({ {} }) - mark({}) + mark({}) jmp?(L2) NEXT:[r({}), d({})] - d({}) NEXT:[] + d({}) NEXT:[] L2: r({}) PREV:[jmp?(L2)] L1: - NEXT:[] + NEXT:[] error: PREV:[] sink: PREV:[, , d({})] L3: - - mark() + + mark() read (Unit) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: @@ -32,11 +32,11 @@ sink: {} --------------------- L3: - - mark() + + mark() read (Unit) L4: - NEXT:[] + NEXT:[] error: PREV:[] sink: diff --git a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java index 54bdb9a7c4e..aebb66607bb 100644 --- a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java +++ b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java @@ -18,6 +18,7 @@ package org.jetbrains.jet.cfg; import com.google.common.collect.Sets; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.text.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.ConfigurationKind; @@ -234,20 +235,23 @@ public abstract class AbstractControlFlowTest extends KotlinTestWithEnvironment } } - out.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions)); + StringBuilder line = new StringBuilder(); + + line.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions)); // Only print NEXT and PREV if the values are non-trivial Instruction next = i == instructions.size() - 1 ? null : instructions.get(i + 1); Collection nextInstructions = instruction.getNextInstructions(); if (!sameContents(next, nextInstructions)) { - out.append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(nextInstructions))); + line.append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(nextInstructions))); } Instruction prev = i == 0 ? null : instructions.get(i - 1); Collection previousInstructions = instruction.getPreviousInstructions(); if (!sameContents(prev, previousInstructions)) { - out.append(" PREV:").append(formatInstructionList(previousInstructions)); + line.append(" PREV:").append(formatInstructionList(previousInstructions)); } + out.append(StringUtil.trimTrailing(line.toString())); out.append("\n"); } for (PseudocodeImpl local : locals) {