Pseudocode: Generate additional returns for implicit return values (lambdas, functions with expression bodies)
This commit is contained in:
@@ -79,12 +79,13 @@ L3:
|
||||
3 <START>
|
||||
4 mark(1)
|
||||
r(1) -> <v0>
|
||||
3 ret(*|<v0>) L4
|
||||
L4:
|
||||
3 <END> NEXT:[<SINK>]
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== foo ==
|
||||
fun foo(a : Boolean, b : Int) : Unit {}
|
||||
|
||||
@@ -4,10 +4,11 @@ fun short() = 1
|
||||
L0:
|
||||
1 <START>
|
||||
r(1) -> <v0>
|
||||
ret(*|<v0>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -45,12 +45,13 @@ override fun foo() = 10
|
||||
L0:
|
||||
1 <START>
|
||||
r(10) -> <v0>
|
||||
ret(*|<v0>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== foo ==
|
||||
fun foo(b: B) : Int {
|
||||
|
||||
@@ -19,12 +19,13 @@ fun component1() = 1
|
||||
L0:
|
||||
1 <START>
|
||||
r(1) -> <v0>
|
||||
ret(*|<v0>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== component2 ==
|
||||
fun component2() = 2
|
||||
@@ -32,12 +33,13 @@ fun component2() = 2
|
||||
L0:
|
||||
1 <START>
|
||||
r(2) -> <v0>
|
||||
ret(*|<v0>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== test ==
|
||||
fun test(c: C) {
|
||||
|
||||
@@ -24,6 +24,7 @@ L0:
|
||||
magic(p: PropertyMetadata) -> <v1>
|
||||
w(p|<v1>)
|
||||
r(0) -> <v2>
|
||||
ret(*|<v2>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ L0:
|
||||
r($bar|<v1>) -> <v2>
|
||||
mark("foo" + this.$bar)
|
||||
call("foo" + this.$bar, plus|<v0>, <v2>) -> <v3>
|
||||
ret(*|<v3>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
|
||||
@@ -17,6 +17,7 @@ L2 [after default value for parameter i]:
|
||||
r(j) -> <v5>
|
||||
mark(i + j)
|
||||
call(i + j, plus|<v4>, <v5>) -> <v6>
|
||||
ret(*|<v6>) L1
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user