Control-Flow Analysis: Use PSI to generate pseudocode if nested resolved call is confused with outer one (e.g. a {} when invoke() is missing)
#KT-14500 Fixed
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
== A ==
|
||||
class A
|
||||
---------------------
|
||||
L0:
|
||||
1 <START>
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== test ==
|
||||
fun test(a: A) {
|
||||
a { }
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
1 <START>
|
||||
v(a: A)
|
||||
magic[FAKE_INITIALIZER](a: A) -> <v0>
|
||||
w(a|<v0>)
|
||||
2 mark({ a { } })
|
||||
mark({ })
|
||||
jmp?(L2) NEXT:[r({ }) -> <v1>, d({ })]
|
||||
d({ }) NEXT:[<SINK>]
|
||||
L2 [after local declaration]:
|
||||
r({ }) -> <v1> PREV:[jmp?(L2)]
|
||||
r(a) -> <v2>
|
||||
mark(a { })
|
||||
magic[UNRESOLVED_CALL](a { }|<v1>, <v2>) -> <v3>
|
||||
L1:
|
||||
1 <END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>, d({ })]
|
||||
=====================
|
||||
== anonymous_0 ==
|
||||
{ }
|
||||
---------------------
|
||||
L3:
|
||||
3 <START>
|
||||
4 mark()
|
||||
read (Unit)
|
||||
L4:
|
||||
3 <END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
Reference in New Issue
Block a user