[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
+134 -120
View File
@@ -30,67 +30,77 @@ digraph when_kt {
subgraph cluster_5 {
color=blue
10 [label="Enter when branch condition "];
11 [label="Access variable R|<local>/x|"];
12 [label="Const: Int(2)"];
13 [label="Function call: R|<local>/x|.R|kotlin/Int.rem|(...)" style="filled" fillcolor=yellow];
14 [label="Const: Int(0)"];
15 [label="Equality operator =="];
16 [label="Exit when branch condition"];
}
subgraph cluster_6 {
color=blue
17 [label="Enter when branch condition "];
18 [label="Const: Int(1)"];
19 [label="Const: Int(1)"];
20 [label="Function call: Int(1).R|kotlin/Int.minus|(...)" style="filled" fillcolor=yellow];
21 [label="Const: Int(0)"];
22 [label="Equality operator =="];
23 [label="Exit when branch condition"];
subgraph cluster_6 {
color=blue
11 [label="Function call arguments enter"];
12 [label="Access variable R|<local>/x|"];
13 [label="Const: Int(2)"];
14 [label="Function call arguments exit"];
}
15 [label="Function call: R|<local>/x|.R|kotlin/Int.rem|(...)" style="filled" fillcolor=yellow];
16 [label="Const: Int(0)"];
17 [label="Equality operator =="];
18 [label="Exit when branch condition"];
}
subgraph cluster_7 {
color=blue
24 [label="Enter when branch condition else"];
25 [label="Exit when branch condition"];
19 [label="Enter when branch condition "];
subgraph cluster_8 {
color=blue
20 [label="Function call arguments enter"];
21 [label="Const: Int(1)"];
22 [label="Const: Int(1)"];
23 [label="Function call arguments exit"];
}
24 [label="Function call: Int(1).R|kotlin/Int.minus|(...)" style="filled" fillcolor=yellow];
25 [label="Const: Int(0)"];
26 [label="Equality operator =="];
27 [label="Exit when branch condition"];
}
26 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
27 [label="Enter block"];
28 [label="Const: Int(5)"];
29 [label="Exit block"];
}
30 [label="Exit when branch result"];
31 [label="Enter when branch result"];
subgraph cluster_9 {
color=blue
32 [label="Enter block"];
33 [label="Jump: ^test_1 Unit"];
34 [label="Stub" style="filled" fillcolor=gray];
35 [label="Exit block" style="filled" fillcolor=gray];
28 [label="Enter when branch condition else"];
29 [label="Exit when branch condition"];
}
36 [label="Exit when branch result" style="filled" fillcolor=gray];
37 [label="Enter when branch result"];
30 [label="Enter when branch result"];
subgraph cluster_10 {
color=blue
38 [label="Enter block"];
39 [label="Const: Int(20)"];
40 [label="Exit block"];
31 [label="Enter block"];
32 [label="Const: Int(5)"];
33 [label="Exit block"];
}
41 [label="Exit when branch result"];
42 [label="Enter when branch result"];
34 [label="Exit when branch result"];
35 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
43 [label="Enter block"];
44 [label="Const: Int(10)"];
45 [label="Exit block"];
36 [label="Enter block"];
37 [label="Jump: ^test_1 Unit"];
38 [label="Stub" style="filled" fillcolor=gray];
39 [label="Exit block" style="filled" fillcolor=gray];
}
46 [label="Exit when branch result"];
47 [label="Exit when"];
40 [label="Exit when branch result" style="filled" fillcolor=gray];
41 [label="Enter when branch result"];
subgraph cluster_12 {
color=blue
42 [label="Enter block"];
43 [label="Const: Int(20)"];
44 [label="Exit block"];
}
45 [label="Exit when branch result"];
46 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
47 [label="Enter block"];
48 [label="Const: Int(10)"];
49 [label="Exit block"];
}
50 [label="Exit when branch result"];
51 [label="Exit when"];
}
48 [label="Variable declaration: lval y: R|kotlin/Int|"];
49 [label="Exit block"];
52 [label="Variable declaration: lval y: R|kotlin/Int|"];
53 [label="Exit block"];
}
50 [label="Exit function test_1" style="filled" fillcolor=red];
54 [label="Exit function test_1" style="filled" fillcolor=red];
}
2 -> {3};
3 -> {4};
@@ -99,129 +109,133 @@ digraph when_kt {
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {10 42};
9 -> {10 46};
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17 37};
16 -> {17};
17 -> {18};
18 -> {19};
18 -> {19 41};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24 31};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
27 -> {28 35};
28 -> {29};
29 -> {30};
30 -> {47};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {50};
33 -> {34} [style=dotted];
34 -> {35} [style=dotted];
35 -> {36} [style=dotted];
36 -> {47} [style=dotted];
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {47};
33 -> {34};
34 -> {51};
35 -> {36};
36 -> {37};
37 -> {54};
37 -> {38} [style=dotted];
38 -> {39} [style=dotted];
39 -> {40} [style=dotted];
40 -> {51} [style=dotted];
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
45 -> {51};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
subgraph cluster_12 {
color=red
51 [label="Enter class A" style="filled" fillcolor=red];
52 [label="Exit class A" style="filled" fillcolor=red];
}
51 -> {52} [color=green];
subgraph cluster_13 {
color=red
53 [label="Enter class B" style="filled" fillcolor=red];
54 [label="Exit class B" style="filled" fillcolor=red];
}
53 -> {54} [color=green];
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
subgraph cluster_14 {
color=red
55 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_15 {
55 [label="Enter class A" style="filled" fillcolor=red];
56 [label="Exit class A" style="filled" fillcolor=red];
}
55 -> {56} [color=green];
subgraph cluster_15 {
color=red
57 [label="Enter class B" style="filled" fillcolor=red];
58 [label="Exit class B" style="filled" fillcolor=red];
}
57 -> {58} [color=green];
subgraph cluster_16 {
color=red
59 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
56 [label="Enter block"];
subgraph cluster_16 {
60 [label="Enter block"];
subgraph cluster_18 {
color=blue
57 [label="Enter when"];
subgraph cluster_17 {
color=blue
58 [label="Enter when branch condition "];
subgraph cluster_18 {
color=blue
59 [label="Enter &&"];
60 [label="Access variable R|<local>/x|"];
61 [label="Type operator: (R|<local>/x| is R|A|)"];
62 [label="Exit left part of &&"];
63 [label="Enter right part of &&"];
64 [label="Access variable R|<local>/x|"];
65 [label="Smart cast: R|<local>/x|"];
66 [label="Type operator: (R|<local>/x| is R|B|)"];
67 [label="Exit &&"];
}
68 [label="Exit when branch condition"];
}
69 [label="Synthetic else branch"];
70 [label="Enter when branch result"];
61 [label="Enter when"];
subgraph cluster_19 {
color=blue
71 [label="Enter block"];
72 [label="Access variable R|<local>/x|"];
73 [label="Smart cast: R|<local>/x|"];
74 [label="Type operator: (R|<local>/x| is R|A|)"];
75 [label="Exit block"];
62 [label="Enter when branch condition "];
subgraph cluster_20 {
color=blue
63 [label="Enter &&"];
64 [label="Access variable R|<local>/x|"];
65 [label="Type operator: (R|<local>/x| is R|A|)"];
66 [label="Exit left part of &&"];
67 [label="Enter right part of &&"];
68 [label="Access variable R|<local>/x|"];
69 [label="Smart cast: R|<local>/x|"];
70 [label="Type operator: (R|<local>/x| is R|B|)"];
71 [label="Exit &&"];
}
72 [label="Exit when branch condition"];
}
76 [label="Exit when branch result"];
77 [label="Exit when"];
73 [label="Synthetic else branch"];
74 [label="Enter when branch result"];
subgraph cluster_21 {
color=blue
75 [label="Enter block"];
76 [label="Access variable R|<local>/x|"];
77 [label="Smart cast: R|<local>/x|"];
78 [label="Type operator: (R|<local>/x| is R|A|)"];
79 [label="Exit block"];
}
80 [label="Exit when branch result"];
81 [label="Exit when"];
}
78 [label="Exit block"];
82 [label="Exit block"];
}
79 [label="Exit function test_2" style="filled" fillcolor=red];
83 [label="Exit function test_2" style="filled" fillcolor=red];
}
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63 67};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
66 -> {67 71};
67 -> {68};
68 -> {69 70};
69 -> {77};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
72 -> {73 74};
73 -> {81};
74 -> {75};
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
}