FIR CFA: rewrite handling of try-catch-finally
The result is the same, but it should now be much clearer what the shortcomings of the current implementation are.
This commit is contained in:
@@ -50,13 +50,13 @@ digraph annotatedLocalClass_kt {
|
||||
20 [label="Function call: R|/bar|()" style="filled" fillcolor=yellow];
|
||||
21 [label="Exit block"];
|
||||
}
|
||||
subgraph cluster_7 {
|
||||
color=blue
|
||||
23 [label="Enter class Local" style="filled" fillcolor=red];
|
||||
24 [label="Exit class Local" style="filled" fillcolor=red];
|
||||
}
|
||||
22 [label="Exit function foo" style="filled" fillcolor=red];
|
||||
}
|
||||
subgraph cluster_7 {
|
||||
color=blue
|
||||
23 [label="Enter class Local" style="filled" fillcolor=red];
|
||||
24 [label="Exit class Local" style="filled" fillcolor=red];
|
||||
}
|
||||
5 -> {6};
|
||||
6 -> {7};
|
||||
7 -> {8};
|
||||
|
||||
+18
-18
@@ -190,19 +190,19 @@ digraph jumps_kt {
|
||||
68 [label="Access variable R|<local>/x|"];
|
||||
69 [label="Type operator: (R|<local>/x| as R|kotlin/Int|)"];
|
||||
70 [label="Jump: break@@@[Boolean(true)] "];
|
||||
71 [label="Stub" style="filled" fillcolor=gray];
|
||||
72 [label="Exit block" style="filled" fillcolor=gray];
|
||||
77 [label="Stub" style="filled" fillcolor=gray];
|
||||
78 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
73 [label="Exit loop block" style="filled" fillcolor=gray];
|
||||
79 [label="Exit loop block" style="filled" fillcolor=gray];
|
||||
}
|
||||
74 [label="Exit whileloop"];
|
||||
71 [label="Exit whileloop"];
|
||||
}
|
||||
75 [label="Access variable R|<local>/x|"];
|
||||
76 [label="Smart cast: R|<local>/x|"];
|
||||
77 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
|
||||
78 [label="Exit block"];
|
||||
72 [label="Access variable R|<local>/x|"];
|
||||
73 [label="Smart cast: R|<local>/x|"];
|
||||
74 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
|
||||
75 [label="Exit block"];
|
||||
}
|
||||
79 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
76 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
}
|
||||
60 -> {61};
|
||||
61 -> {62};
|
||||
@@ -210,21 +210,21 @@ digraph jumps_kt {
|
||||
63 -> {64};
|
||||
64 -> {65};
|
||||
65 -> {66};
|
||||
65 -> {74} [style=dotted];
|
||||
65 -> {71} [style=dotted];
|
||||
66 -> {67};
|
||||
67 -> {68};
|
||||
68 -> {69};
|
||||
69 -> {70};
|
||||
70 -> {74};
|
||||
70 -> {71} [style=dotted];
|
||||
71 -> {72} [style=dotted];
|
||||
72 -> {73} [style=dotted];
|
||||
73 -> {63} [color=green style=dotted];
|
||||
70 -> {71};
|
||||
70 -> {77} [style=dotted];
|
||||
71 -> {72};
|
||||
72 -> {73};
|
||||
73 -> {74};
|
||||
74 -> {75};
|
||||
75 -> {76};
|
||||
76 -> {77};
|
||||
77 -> {78};
|
||||
78 -> {79};
|
||||
77 -> {78} [style=dotted];
|
||||
78 -> {79} [style=dotted];
|
||||
79 -> {63} [color=green style=dotted];
|
||||
|
||||
subgraph cluster_20 {
|
||||
color=red
|
||||
|
||||
+5
-5
@@ -64,13 +64,13 @@ digraph localClassesWithImplicit_kt {
|
||||
26 [label="Variable declaration: lval x: R|<anonymous>|"];
|
||||
27 [label="Exit block"];
|
||||
}
|
||||
subgraph cluster_8 {
|
||||
color=blue
|
||||
29 [label="Enter class A" style="filled" fillcolor=red];
|
||||
30 [label="Exit class A" style="filled" fillcolor=red];
|
||||
}
|
||||
28 [label="Exit function test" style="filled" fillcolor=red];
|
||||
}
|
||||
subgraph cluster_8 {
|
||||
color=blue
|
||||
29 [label="Enter class A" style="filled" fillcolor=red];
|
||||
30 [label="Exit class A" style="filled" fillcolor=red];
|
||||
}
|
||||
7 -> {8};
|
||||
8 -> {9};
|
||||
9 -> {10};
|
||||
|
||||
+21
-21
@@ -276,22 +276,22 @@ digraph loops_kt {
|
||||
color=blue
|
||||
94 [label="Enter block"];
|
||||
95 [label="Jump: break@@@[Boolean(true)] "];
|
||||
96 [label="Stub" style="filled" fillcolor=gray];
|
||||
97 [label="Exit block" style="filled" fillcolor=gray];
|
||||
100 [label="Stub" style="filled" fillcolor=gray];
|
||||
101 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
98 [label="Exit when branch result" style="filled" fillcolor=gray];
|
||||
99 [label="Exit when"];
|
||||
102 [label="Exit when branch result" style="filled" fillcolor=gray];
|
||||
103 [label="Exit when"];
|
||||
}
|
||||
100 [label="Exit block"];
|
||||
104 [label="Exit block"];
|
||||
}
|
||||
101 [label="Exit loop block"];
|
||||
105 [label="Exit loop block"];
|
||||
}
|
||||
102 [label="Exit whileloop"];
|
||||
96 [label="Exit whileloop"];
|
||||
}
|
||||
103 [label="Const: Int(1)"];
|
||||
104 [label="Exit block"];
|
||||
97 [label="Const: Int(1)"];
|
||||
98 [label="Exit block"];
|
||||
}
|
||||
105 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red];
|
||||
99 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red];
|
||||
}
|
||||
80 -> {81};
|
||||
81 -> {82};
|
||||
@@ -299,27 +299,27 @@ digraph loops_kt {
|
||||
83 -> {84};
|
||||
84 -> {85};
|
||||
85 -> {86};
|
||||
85 -> {102} [style=dotted];
|
||||
85 -> {96} [style=dotted];
|
||||
86 -> {87};
|
||||
87 -> {88};
|
||||
88 -> {89};
|
||||
89 -> {90};
|
||||
90 -> {91};
|
||||
91 -> {92 93};
|
||||
92 -> {99};
|
||||
92 -> {103};
|
||||
93 -> {94};
|
||||
94 -> {95};
|
||||
95 -> {102};
|
||||
95 -> {96} [style=dotted];
|
||||
96 -> {97} [style=dotted];
|
||||
97 -> {98} [style=dotted];
|
||||
98 -> {99} [style=dotted];
|
||||
99 -> {100};
|
||||
100 -> {101};
|
||||
101 -> {83} [color=green style=dashed];
|
||||
102 -> {103};
|
||||
95 -> {96};
|
||||
95 -> {100} [style=dotted];
|
||||
96 -> {97};
|
||||
97 -> {98};
|
||||
98 -> {99};
|
||||
100 -> {101} [style=dotted];
|
||||
101 -> {102} [style=dotted];
|
||||
102 -> {103} [style=dotted];
|
||||
103 -> {104};
|
||||
104 -> {105};
|
||||
105 -> {83} [color=green style=dashed];
|
||||
|
||||
subgraph cluster_34 {
|
||||
color=red
|
||||
|
||||
+40
-40
@@ -27,12 +27,12 @@ digraph tryCatch_kt {
|
||||
subgraph cluster_5 {
|
||||
color=blue
|
||||
9 [label="Catch enter"];
|
||||
10 [label="Variable declaration: e: R|kotlin/Exception|"];
|
||||
10 [label="Variable declaration: e: R|kotlin/RuntimeException|"];
|
||||
subgraph cluster_6 {
|
||||
color=blue
|
||||
11 [label="Enter block"];
|
||||
12 [label="Const: Int(3)"];
|
||||
13 [label="Variable declaration: lval z: R|kotlin/Int|"];
|
||||
12 [label="Const: Int(2)"];
|
||||
13 [label="Variable declaration: lval y: R|kotlin/Int|"];
|
||||
14 [label="Exit block"];
|
||||
}
|
||||
15 [label="Catch exit"];
|
||||
@@ -40,12 +40,12 @@ digraph tryCatch_kt {
|
||||
subgraph cluster_7 {
|
||||
color=blue
|
||||
16 [label="Catch enter"];
|
||||
17 [label="Variable declaration: e: R|kotlin/RuntimeException|"];
|
||||
17 [label="Variable declaration: e: R|kotlin/Exception|"];
|
||||
subgraph cluster_8 {
|
||||
color=blue
|
||||
18 [label="Enter block"];
|
||||
19 [label="Const: Int(2)"];
|
||||
20 [label="Variable declaration: lval y: R|kotlin/Int|"];
|
||||
19 [label="Const: Int(3)"];
|
||||
20 [label="Variable declaration: lval z: R|kotlin/Int|"];
|
||||
21 [label="Exit block"];
|
||||
}
|
||||
22 [label="Catch exit"];
|
||||
@@ -224,11 +224,11 @@ digraph tryCatch_kt {
|
||||
subgraph cluster_31 {
|
||||
color=blue
|
||||
84 [label="Catch enter"];
|
||||
85 [label="Variable declaration: e: R|kotlin/RuntimeException|"];
|
||||
85 [label="Variable declaration: e: R|kotlin/Exception|"];
|
||||
subgraph cluster_32 {
|
||||
color=blue
|
||||
86 [label="Enter block"];
|
||||
87 [label="Jump: break@@@[Boolean(true)] "];
|
||||
87 [label="Jump: continue@@@[Boolean(true)] "];
|
||||
88 [label="Stub" style="filled" fillcolor=gray];
|
||||
89 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
@@ -236,32 +236,32 @@ digraph tryCatch_kt {
|
||||
}
|
||||
subgraph cluster_33 {
|
||||
color=blue
|
||||
95 [label="Catch enter"];
|
||||
96 [label="Variable declaration: e: R|kotlin/Exception|"];
|
||||
91 [label="Catch enter"];
|
||||
92 [label="Variable declaration: e: R|kotlin/RuntimeException|"];
|
||||
subgraph cluster_34 {
|
||||
color=blue
|
||||
97 [label="Enter block"];
|
||||
98 [label="Jump: continue@@@[Boolean(true)] "];
|
||||
99 [label="Stub" style="filled" fillcolor=gray];
|
||||
100 [label="Exit block" style="filled" fillcolor=gray];
|
||||
93 [label="Enter block"];
|
||||
94 [label="Jump: break@@@[Boolean(true)] "];
|
||||
100 [label="Stub" style="filled" fillcolor=gray];
|
||||
101 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
101 [label="Catch exit" style="filled" fillcolor=gray];
|
||||
102 [label="Catch exit" style="filled" fillcolor=gray];
|
||||
}
|
||||
102 [label="Try expression exit"];
|
||||
103 [label="Try expression exit"];
|
||||
}
|
||||
103 [label="Const: Int(2)"];
|
||||
104 [label="Variable declaration: lval y: R|kotlin/Int|"];
|
||||
105 [label="Exit block"];
|
||||
104 [label="Const: Int(2)"];
|
||||
105 [label="Variable declaration: lval y: R|kotlin/Int|"];
|
||||
106 [label="Exit block"];
|
||||
}
|
||||
106 [label="Exit loop block"];
|
||||
107 [label="Exit loop block"];
|
||||
}
|
||||
91 [label="Exit whileloop"];
|
||||
95 [label="Exit whileloop"];
|
||||
}
|
||||
92 [label="Const: Int(3)"];
|
||||
93 [label="Variable declaration: lval z: R|kotlin/Int|"];
|
||||
94 [label="Exit block"];
|
||||
96 [label="Const: Int(3)"];
|
||||
97 [label="Variable declaration: lval z: R|kotlin/Int|"];
|
||||
98 [label="Exit block"];
|
||||
}
|
||||
107 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
99 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
}
|
||||
44 -> {45};
|
||||
45 -> {46};
|
||||
@@ -269,10 +269,10 @@ digraph tryCatch_kt {
|
||||
47 -> {48};
|
||||
48 -> {49};
|
||||
49 -> {50};
|
||||
49 -> {91} [style=dotted];
|
||||
49 -> {95} [style=dotted];
|
||||
50 -> {51};
|
||||
51 -> {52};
|
||||
52 -> {53 84 95};
|
||||
52 -> {53 84 91};
|
||||
53 -> {54};
|
||||
54 -> {55};
|
||||
55 -> {56};
|
||||
@@ -282,7 +282,7 @@ digraph tryCatch_kt {
|
||||
59 -> {66};
|
||||
60 -> {61};
|
||||
61 -> {62};
|
||||
62 -> {107};
|
||||
62 -> {99};
|
||||
62 -> {63} [style=dotted];
|
||||
63 -> {64} [style=dotted];
|
||||
64 -> {65} [style=dotted];
|
||||
@@ -298,40 +298,40 @@ digraph tryCatch_kt {
|
||||
74 -> {81};
|
||||
75 -> {76};
|
||||
76 -> {77};
|
||||
77 -> {91};
|
||||
77 -> {95};
|
||||
77 -> {78} [style=dotted];
|
||||
78 -> {79} [style=dotted];
|
||||
79 -> {80} [style=dotted];
|
||||
80 -> {81} [style=dotted];
|
||||
81 -> {82};
|
||||
82 -> {83};
|
||||
83 -> {84 95 102};
|
||||
83 -> {84 91 103};
|
||||
84 -> {85};
|
||||
84 -> {107} [label="onUncaughtException"];
|
||||
84 -> {99} [label="onUncaughtException"];
|
||||
85 -> {86};
|
||||
86 -> {87};
|
||||
87 -> {91};
|
||||
87 -> {47} [color=green style=dashed];
|
||||
87 -> {88} [style=dotted];
|
||||
88 -> {89} [style=dotted];
|
||||
89 -> {90} [style=dotted];
|
||||
90 -> {102} [style=dotted];
|
||||
90 -> {103} [style=dotted];
|
||||
91 -> {92};
|
||||
91 -> {99} [label="onUncaughtException"];
|
||||
92 -> {93};
|
||||
93 -> {94};
|
||||
94 -> {107};
|
||||
94 -> {95};
|
||||
94 -> {100} [style=dotted];
|
||||
95 -> {96};
|
||||
95 -> {107} [label="onUncaughtException"];
|
||||
96 -> {97};
|
||||
97 -> {98};
|
||||
98 -> {47} [color=green style=dashed];
|
||||
98 -> {99} [style=dotted];
|
||||
99 -> {100} [style=dotted];
|
||||
98 -> {99};
|
||||
100 -> {101} [style=dotted];
|
||||
101 -> {102} [style=dotted];
|
||||
102 -> {103};
|
||||
102 -> {103} [style=dotted];
|
||||
103 -> {104};
|
||||
104 -> {105};
|
||||
105 -> {106};
|
||||
106 -> {47} [color=green style=dashed];
|
||||
106 -> {107};
|
||||
107 -> {47} [color=green style=dashed];
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ digraph variableInitializedInTryBlock_kt {
|
||||
23 -> {24};
|
||||
24 -> {25};
|
||||
25 -> {26};
|
||||
25 -> {30} [label="return@/test"];
|
||||
25 -> {30} [label="onUncaughtException"];
|
||||
26 -> {27};
|
||||
27 -> {28};
|
||||
28 -> {29};
|
||||
|
||||
Reference in New Issue
Block a user