[FIR] Rewind DFA after call arguments for correct receiver smartcasting

^KT-63709 Fixed
This commit is contained in:
Brian Norman
2023-11-27 13:48:09 -06:00
committed by Space Team
parent 38d5e56530
commit 0881910a1b
128 changed files with 22457 additions and 16148 deletions
@@ -21,117 +21,142 @@ digraph propertiesAndInitBlocks_kt {
subgraph cluster_3 {
color=blue
7 [label="Enter property" style="filled" fillcolor=red];
8 [label="Postponed enter to lambda"];
subgraph cluster_4 {
color=blue
9 [label="Enter function <anonymous>" style="filled" fillcolor=red];
8 [label="Function call arguments enter"];
9 [label="Postponed enter to lambda"];
subgraph cluster_5 {
color=blue
10 [label="Enter block"];
11 [label="Local function declaration"];
12 [label="Local class declaration"];
13 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
14 [label="Throw: throw R|java/lang/Exception.Exception|()"];
15 [label="Stub" style="filled" fillcolor=gray];
16 [label="Exit block" style="filled" fillcolor=gray];
}
17 [label="Exit function <anonymous>" style="filled" fillcolor=gray];
}
subgraph cluster_6 {
color=blue
18 [label="Enter class InitializerLocalClass" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
19 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_8 {
10 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
20 [label="Enter block"];
21 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
22 [label="Throw: throw R|java/lang/Exception.Exception|()"];
23 [label="Stub" style="filled" fillcolor=gray];
24 [label="Const: Int(1)" style="filled" fillcolor=gray];
25 [label="Exit block" style="filled" fillcolor=gray];
11 [label="Enter block"];
12 [label="Local function declaration"];
13 [label="Local class declaration"];
subgraph cluster_7 {
color=blue
14 [label="Function call arguments enter"];
15 [label="Function call arguments exit"];
}
16 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
17 [label="Throw: throw R|java/lang/Exception.Exception|()"];
18 [label="Stub" style="filled" fillcolor=gray];
19 [label="Exit block" style="filled" fillcolor=gray];
}
26 [label="Exit init block" style="filled" fillcolor=gray];
20 [label="Exit function <anonymous>" style="filled" fillcolor=gray];
}
subgraph cluster_9 {
subgraph cluster_8 {
color=blue
27 [label="Enter function <init>" style="filled" fillcolor=gray];
28 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=gray];
29 [label="Exit function <init>" style="filled" fillcolor=gray];
21 [label="Enter class InitializerLocalClass" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
22 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
23 [label="Enter block"];
subgraph cluster_11 {
color=blue
24 [label="Function call arguments enter"];
25 [label="Function call arguments exit"];
}
26 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
27 [label="Throw: throw R|java/lang/Exception.Exception|()"];
28 [label="Stub" style="filled" fillcolor=gray];
29 [label="Const: Int(1)" style="filled" fillcolor=gray];
30 [label="Exit block" style="filled" fillcolor=gray];
}
31 [label="Exit init block" style="filled" fillcolor=gray];
}
subgraph cluster_12 {
color=blue
32 [label="Enter function <init>" style="filled" fillcolor=gray];
33 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=gray];
34 [label="Exit function <init>" style="filled" fillcolor=gray];
}
35 [label="Exit class InitializerLocalClass" style="filled" fillcolor=gray];
}
30 [label="Exit class InitializerLocalClass" style="filled" fillcolor=gray];
}
subgraph cluster_10 {
color=blue
31 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_11 {
subgraph cluster_13 {
color=blue
32 [label="Enter block"];
33 [label="Const: Int(1)"];
34 [label="Const: Int(1)"];
35 [label="Function call: Int(1).R|kotlin/Int.plus|(...)" style="filled" fillcolor=yellow];
36 [label="Variable declaration: lval c: R|kotlin/Int|"];
37 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
38 [label="Throw: throw R|java/lang/Exception.Exception|()"];
39 [label="Stub" style="filled" fillcolor=gray];
40 [label="Exit block" style="filled" fillcolor=gray];
36 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_14 {
color=blue
37 [label="Enter block"];
subgraph cluster_15 {
color=blue
38 [label="Function call arguments enter"];
39 [label="Const: Int(1)"];
40 [label="Const: Int(1)"];
41 [label="Function call arguments exit"];
}
42 [label="Function call: Int(1).R|kotlin/Int.plus|(...)" style="filled" fillcolor=yellow];
43 [label="Variable declaration: lval c: R|kotlin/Int|"];
subgraph cluster_16 {
color=blue
44 [label="Function call arguments enter"];
45 [label="Function call arguments exit"];
}
46 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
47 [label="Throw: throw R|java/lang/Exception.Exception|()"];
48 [label="Stub" style="filled" fillcolor=gray];
49 [label="Exit block" style="filled" fillcolor=gray];
}
50 [label="Exit function foo" style="filled" fillcolor=gray];
}
41 [label="Exit function foo" style="filled" fillcolor=gray];
51 [label="Function call arguments exit"];
}
42 [label="Postponed exit from lambda"];
43 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow];
44 [label="Exit property" style="filled" fillcolor=red];
52 [label="Postponed exit from lambda"];
53 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow];
54 [label="Exit property" style="filled" fillcolor=red];
}
subgraph cluster_12 {
subgraph cluster_17 {
color=blue
45 [label="Enter property" style="filled" fillcolor=red];
subgraph cluster_13 {
55 [label="Enter property" style="filled" fillcolor=red];
subgraph cluster_18 {
color=blue
46 [label="Try expression enter"];
subgraph cluster_14 {
56 [label="Try expression enter"];
subgraph cluster_19 {
color=blue
47 [label="Try main block enter"];
subgraph cluster_15 {
57 [label="Try main block enter"];
subgraph cluster_20 {
color=blue
48 [label="Enter block"];
49 [label="Const: Int(1)"];
50 [label="Exit block"];
58 [label="Enter block"];
59 [label="Const: Int(1)"];
60 [label="Exit block"];
}
51 [label="Try main block exit"];
61 [label="Try main block exit"];
}
subgraph cluster_16 {
subgraph cluster_21 {
color=blue
52 [label="Catch enter"];
53 [label="Variable declaration: e: R|kotlin/Exception|"];
subgraph cluster_17 {
62 [label="Catch enter"];
63 [label="Variable declaration: e: R|kotlin/Exception|"];
subgraph cluster_22 {
color=blue
54 [label="Enter block"];
55 [label="Const: Int(2)"];
56 [label="Exit block"];
64 [label="Enter block"];
65 [label="Const: Int(2)"];
66 [label="Exit block"];
}
57 [label="Catch exit"];
67 [label="Catch exit"];
}
subgraph cluster_18 {
subgraph cluster_23 {
color=blue
58 [label="Enter finally"];
subgraph cluster_19 {
68 [label="Enter finally"];
subgraph cluster_24 {
color=blue
59 [label="Enter block"];
60 [label="Const: Int(0)"];
61 [label="Exit block"];
69 [label="Enter block"];
70 [label="Const: Int(0)"];
71 [label="Exit block"];
}
62 [label="Exit finally"];
72 [label="Exit finally"];
}
63 [label="Try expression exit"];
73 [label="Try expression exit"];
}
64 [label="Exit property" style="filled" fillcolor=red];
74 [label="Exit property" style="filled" fillcolor=red];
}
65 [label="Exit file propertiesAndInitBlocks.kt" style="filled" fillcolor=red];
75 [label="Exit file propertiesAndInitBlocks.kt" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
0 -> {65} [style=dotted];
0 -> {1 4 7 45} [style=dashed];
0 -> {75} [style=dotted];
0 -> {1 4 7 55} [style=dashed];
1 -> {2};
2 -> {3};
3 -> {4} [color=green];
@@ -139,179 +164,203 @@ digraph propertiesAndInitBlocks_kt {
5 -> {6};
6 -> {7} [color=green];
7 -> {8};
8 -> {9 42 43};
8 -> {9} [style=dashed];
9 -> {10};
8 -> {9};
9 -> {10 51 52};
9 -> {10} [style=dashed];
10 -> {11};
11 -> {12 31};
11 -> {31} [style=dashed];
12 -> {13 18};
12 -> {18} [style=dashed];
13 -> {14};
14 -> {15} [style=dotted];
15 -> {16} [style=dotted];
16 -> {17} [style=dotted];
17 -> {42} [style=dotted];
18 -> {19};
18 -> {27} [color=red];
18 -> {30} [style=dotted];
18 -> {19 27} [style=dashed];
19 -> {20};
20 -> {21};
11 -> {12};
12 -> {13 36};
12 -> {36} [style=dashed];
13 -> {14 21};
13 -> {21} [style=dashed];
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18} [style=dotted];
18 -> {19} [style=dotted];
19 -> {20} [style=dotted];
20 -> {52} [style=dotted];
21 -> {22};
22 -> {23} [style=dotted];
23 -> {24} [style=dotted];
24 -> {25} [style=dotted];
25 -> {26} [style=dotted];
26 -> {27} [style=dotted];
21 -> {32} [color=red];
21 -> {35} [style=dotted];
21 -> {22 32} [style=dashed];
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28} [style=dotted];
28 -> {29} [style=dotted];
29 -> {30} [style=dotted];
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
30 -> {31} [style=dotted];
31 -> {32} [style=dotted];
32 -> {33} [style=dotted];
33 -> {34} [style=dotted];
34 -> {35} [style=dotted];
36 -> {37};
37 -> {38};
38 -> {39} [style=dotted];
39 -> {40} [style=dotted];
40 -> {41} [style=dotted];
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
42 -> {8} [color=green style=dashed];
43 -> {44};
44 -> {45} [color=green];
44 -> {45};
45 -> {46};
46 -> {47 52};
46 -> {58} [label="onUncaughtException"];
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52 58};
46 -> {47};
47 -> {48} [style=dotted];
48 -> {49} [style=dotted];
49 -> {50} [style=dotted];
51 -> {53};
52 -> {53};
52 -> {58} [label="onUncaughtException"];
52 -> {9} [color=green style=dashed];
53 -> {54};
54 -> {55};
54 -> {55} [color=green];
55 -> {56};
56 -> {57};
56 -> {57 62};
56 -> {68} [label="onUncaughtException"];
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
61 -> {62 68};
62 -> {63};
62 -> {68} [label="onUncaughtException"];
63 -> {64};
64 -> {65} [color=green];
subgraph cluster_20 {
color=red
66 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
67 [label="Enter block"];
68 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
69 [label="Exit block"];
}
70 [label="Exit function run" style="filled" fillcolor=red];
}
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
subgraph cluster_22 {
color=red
71 [label="Enter function <getter>" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
72 [label="Enter block"];
73 [label="Const: Int(1)"];
74 [label="Jump: ^ Int(1)"];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Exit block" style="filled" fillcolor=gray];
}
77 [label="Exit function <getter>" style="filled" fillcolor=red];
}
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {77};
74 -> {75} [style=dotted];
75 -> {76} [style=dotted];
76 -> {77} [style=dotted];
74 -> {75} [color=green];
subgraph cluster_24 {
subgraph cluster_25 {
color=red
78 [label="Enter function <setter>" style="filled" fillcolor=red];
subgraph cluster_25 {
76 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_26 {
color=blue
79 [label="Enter block"];
80 [label="Const: Int(1)"];
81 [label="Assignment: F|/x2|"];
82 [label="Exit block"];
77 [label="Enter block"];
subgraph cluster_27 {
color=blue
78 [label="Function call arguments enter"];
79 [label="Function call arguments exit"];
}
80 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
81 [label="Exit block"];
}
83 [label="Exit function <setter>" style="filled" fillcolor=red];
82 [label="Exit function run" style="filled" fillcolor=red];
}
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
subgraph cluster_26 {
color=red
84 [label="Enter function <getter>" style="filled" fillcolor=red];
subgraph cluster_27 {
color=blue
85 [label="Enter block"];
86 [label="Local class declaration"];
87 [label="Exit block"];
}
88 [label="Exit function <getter>" style="filled" fillcolor=red];
}
subgraph cluster_28 {
color=blue
89 [label="Enter class GetterLocalClass" style="filled" fillcolor=red];
color=red
83 [label="Enter function <getter>" style="filled" fillcolor=red];
subgraph cluster_29 {
color=blue
90 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_30 {
color=blue
91 [label="Enter block"];
92 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
93 [label="Throw: throw R|java/lang/Exception.Exception|()"];
94 [label="Stub" style="filled" fillcolor=gray];
95 [label="Exit block" style="filled" fillcolor=gray];
}
96 [label="Exit init block" style="filled" fillcolor=gray];
84 [label="Enter block"];
85 [label="Const: Int(1)"];
86 [label="Jump: ^ Int(1)"];
87 [label="Stub" style="filled" fillcolor=gray];
88 [label="Exit block" style="filled" fillcolor=gray];
}
subgraph cluster_31 {
color=blue
97 [label="Enter function <init>" style="filled" fillcolor=gray];
98 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=gray];
99 [label="Exit function <init>" style="filled" fillcolor=gray];
}
100 [label="Exit class GetterLocalClass" style="filled" fillcolor=gray];
89 [label="Exit function <getter>" style="filled" fillcolor=red];
}
83 -> {84};
84 -> {85};
85 -> {86};
86 -> {87 89};
86 -> {89} [style=dashed];
87 -> {88};
89 -> {90};
89 -> {97} [color=red];
89 -> {100} [style=dotted];
89 -> {90 97} [style=dashed];
86 -> {89};
86 -> {87} [style=dotted];
87 -> {88} [style=dotted];
88 -> {89} [style=dotted];
subgraph cluster_30 {
color=red
90 [label="Enter function <setter>" style="filled" fillcolor=red];
subgraph cluster_31 {
color=blue
91 [label="Enter block"];
92 [label="Const: Int(1)"];
93 [label="Assignment: F|/x2|"];
94 [label="Exit block"];
}
95 [label="Exit function <setter>" style="filled" fillcolor=red];
}
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {94} [style=dotted];
94 -> {95} [style=dotted];
95 -> {96} [style=dotted];
96 -> {97} [style=dotted];
97 -> {98} [style=dotted];
98 -> {99} [style=dotted];
99 -> {100} [style=dotted];
93 -> {94};
94 -> {95};
subgraph cluster_32 {
color=red
96 [label="Enter function <getter>" style="filled" fillcolor=red];
subgraph cluster_33 {
color=blue
97 [label="Enter block"];
98 [label="Local class declaration"];
99 [label="Exit block"];
}
100 [label="Exit function <getter>" style="filled" fillcolor=red];
}
subgraph cluster_34 {
color=blue
101 [label="Enter class GetterLocalClass" style="filled" fillcolor=red];
subgraph cluster_35 {
color=blue
102 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_36 {
color=blue
103 [label="Enter block"];
subgraph cluster_37 {
color=blue
104 [label="Function call arguments enter"];
105 [label="Function call arguments exit"];
}
106 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
107 [label="Throw: throw R|java/lang/Exception.Exception|()"];
108 [label="Stub" style="filled" fillcolor=gray];
109 [label="Exit block" style="filled" fillcolor=gray];
}
110 [label="Exit init block" style="filled" fillcolor=gray];
}
subgraph cluster_38 {
color=blue
111 [label="Enter function <init>" style="filled" fillcolor=gray];
112 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=gray];
113 [label="Exit function <init>" style="filled" fillcolor=gray];
}
114 [label="Exit class GetterLocalClass" style="filled" fillcolor=gray];
}
96 -> {97};
97 -> {98};
98 -> {99 101};
98 -> {101} [style=dashed];
99 -> {100};
101 -> {102};
101 -> {111} [color=red];
101 -> {114} [style=dotted];
101 -> {102 111} [style=dashed];
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108} [style=dotted];
108 -> {109} [style=dotted];
109 -> {110} [style=dotted];
110 -> {111} [style=dotted];
111 -> {112} [style=dotted];
112 -> {113} [style=dotted];
113 -> {114} [style=dotted];
}