Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/cfa/initializationInTry.dot
T
Brian Norman f51b7faa1b [FIR] Only track assignment nodes for uncaught exception edges in CFG
UncaughtExceptionPath edges are used to influence smart-casting within
catch and finally blocks. Previously these edges were added from every
node which could throw an exception. But only assignment nodes influence
smart-casts by resetting inference back to some less specific type.
Therefore, instead of tracking every possible node which could throw an
exception - even though almost every statement node can - only add edges
from assignment nodes to catch and finally blocks. This fixes many
missing exception cases and also reduces the total number of incoming
edges to catch and finally blocks.

#KT-56872 Fixed
2023-09-05 11:59:13 +00:00

185 lines
6.2 KiB
Plaintext
Vendored

digraph initializationInTry_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter file initializationInTry.kt" style="filled" fillcolor=red];
1 [label="Exit file initializationInTry.kt" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter function getNullableString" style="filled" fillcolor=red];
subgraph cluster_2 {
color=blue
3 [label="Enter block"];
4 [label="Const: Null(null)"];
5 [label="Jump: ^getNullableString Null(null)"];
6 [label="Stub" style="filled" fillcolor=gray];
7 [label="Exit block" style="filled" fillcolor=gray];
}
8 [label="Exit function getNullableString" style="filled" fillcolor=red];
}
2 -> {3};
3 -> {4};
4 -> {5};
5 -> {8};
5 -> {6} [style=dotted];
6 -> {7} [style=dotted];
7 -> {8} [style=dotted];
subgraph cluster_3 {
color=red
9 [label="Enter function takeNullableString" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
10 [label="Enter block"];
11 [label="Exit block"];
}
12 [label="Exit function takeNullableString" style="filled" fillcolor=red];
}
9 -> {10};
10 -> {11};
11 -> {12};
subgraph cluster_5 {
color=red
13 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
14 [label="Enter block"];
15 [label="Variable declaration: lval x: R|kotlin/String?|"];
subgraph cluster_7 {
color=blue
16 [label="Try expression enter"];
subgraph cluster_8 {
color=blue
17 [label="Try main block enter"];
subgraph cluster_9 {
color=blue
18 [label="Enter block"];
19 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow];
20 [label="Check not null: R|/getNullableString|()!!" style="filled" fillcolor=yellow];
21 [label="Variable declaration: lval y: R|kotlin/String|"];
22 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow];
23 [label="Assignment: R|<local>/x|"];
24 [label="Exit block"];
}
25 [label="Try main block exit"];
}
subgraph cluster_10 {
color=blue
26 [label="Enter finally"];
subgraph cluster_11 {
color=blue
27 [label="Enter block"];
28 [label="Access qualifier kotlin/Unit"];
29 [label="Exit block"];
}
30 [label="Exit finally"];
}
31 [label="Try expression exit"];
}
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|/takeNullableString|(...)" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
35 [label="Exit function test_1" style="filled" fillcolor=red];
}
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17};
16 -> {26} [label="onUncaughtException"];
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
23 -> {26} [label="onUncaughtException"];
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
subgraph cluster_12 {
color=red
36 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
37 [label="Enter block"];
38 [label="Variable declaration: lval x: R|kotlin/String?|"];
subgraph cluster_14 {
color=blue
39 [label="Try expression enter"];
subgraph cluster_15 {
color=blue
40 [label="Try main block enter"];
subgraph cluster_16 {
color=blue
41 [label="Enter block"];
42 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow];
43 [label="Variable declaration: lval y: R|kotlin/String?|"];
44 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow];
45 [label="Assignment: R|<local>/x|"];
46 [label="Exit block"];
}
47 [label="Try main block exit"];
}
subgraph cluster_17 {
color=blue
48 [label="Enter finally"];
subgraph cluster_18 {
color=blue
49 [label="Enter block"];
50 [label="Access qualifier kotlin/Unit"];
51 [label="Exit block"];
}
52 [label="Exit finally"];
}
53 [label="Try expression exit"];
}
54 [label="Access variable R|<local>/x|"];
55 [label="Function call: R|/takeNullableString|(...)" style="filled" fillcolor=yellow];
56 [label="Exit block"];
}
57 [label="Exit function test_2" style="filled" fillcolor=red];
}
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
39 -> {48} [label="onUncaughtException"];
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
45 -> {48} [label="onUncaughtException"];
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
}