C#: Add missing CFG edge from generic catch block to finally block

This commit is contained in:
Tom Hvitved
2020-04-21 20:27:29 +02:00
parent bd075a7de0
commit 5b5f9adfc6
3 changed files with 8 additions and 9 deletions

View File

@@ -1710,9 +1710,9 @@ module ControlFlow {
exists(getAThrownException(ts, cfe, c)) and
result = first(ts.getCatchClause(0))
or
exists(SpecificCatchClause scc, int i | scc = ts.getCatchClause(i) |
cfe = scc and
scc = last(ts.getCatchClause(i), c) and
exists(CatchClause cc, int i | cc = ts.getCatchClause(i) |
cfe = cc and
cc = last(ts.getCatchClause(i), c) and
(
// Flow from one `catch` clause to the next
result = first(ts.getCatchClause(i + 1)) and
@@ -1725,7 +1725,7 @@ module ControlFlow {
)
or
cfe = last(ts.getCatchClause(i), c) and
cfe = last(scc.getFilterClause(), _) and
cfe = last(cc.getFilterClause(), _) and
(
// Flow from last element of `catch` clause filter to next `catch` clause
result = first(ts.getCatchClause(i + 1)) and
@@ -1739,7 +1739,7 @@ module ControlFlow {
)
or
// Flow from last element of a `catch` block to first element of `finally` block
cfe = lastCatchClauseBlock(scc, c) and
cfe = lastCatchClauseBlock(cc, c) and
result = first(ts.getFinally())
)
or