mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C#: Eliminate bad magic optimization
```
[2022-01-14 08:57:14] (253s) Tuple counts for Stmt::getAChild#bbf/3@8dfbc66f after 1m53s:
4922010396 ~5% {3} r1 = JOIN ControlFlowElement::ControlFlowElement::getEnclosingCallable_dispred#ff_10#join_rhs WITH ControlFlowElement::ControlFlowElement::getEnclosingCallable_dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1 'cfe', Rhs.1 'cfe', Lhs.0 'c'
1597068 ~2% {3} r2 = JOIN r1 WITH Element::Element::getAChild_dispred#ff ON FIRST 2 OUTPUT Lhs.0 'cfe', Lhs.2 'c', Lhs.1 'result'
return r2
```
This commit is contained in:
committed by
Michael Nebel
parent
411d2b2876
commit
6c20585fc7
@@ -946,17 +946,13 @@ class TryStmt extends Stmt, @try_stmt {
|
||||
exists(ControlFlowElement mid |
|
||||
mid = this.getATriedElement() and
|
||||
not mid instanceof TryStmt and
|
||||
result = getAChild(mid, mid.getEnclosingCallable())
|
||||
result = mid.getAChild() and
|
||||
pragma[only_bind_into](mid.getEnclosingCallable()) =
|
||||
pragma[only_bind_into](result.getEnclosingCallable())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
private ControlFlowElement getAChild(ControlFlowElement cfe, Callable c) {
|
||||
result = cfe.getAChild() and
|
||||
c = result.getEnclosingCallable()
|
||||
}
|
||||
|
||||
/**
|
||||
* A `catch` clause within a `try` statement.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user