зеркало из https://github.com/github/codeql.git
Merge pull request #14099 from hvitved/csharp/transitive-capture-call-unique
C#: Do not embed target callable in `TransitiveCapturedCall`
This commit is contained in:
Коммит
c68d0bc936
|
@ -109,8 +109,8 @@ private module Cached {
|
|||
TExplicitDelegateLikeCall(ControlFlow::Nodes::ElementNode cfn, DelegateLikeCall dc) {
|
||||
cfn.getAstNode() = dc
|
||||
} or
|
||||
TTransitiveCapturedCall(ControlFlow::Nodes::ElementNode cfn, Callable target) {
|
||||
transitiveCapturedCallTarget(cfn, target)
|
||||
TTransitiveCapturedCall(ControlFlow::Nodes::ElementNode cfn) {
|
||||
transitiveCapturedCallTarget(cfn, _)
|
||||
} or
|
||||
TCilCall(CIL::Call call) {
|
||||
// No need to include calls that are compiled from source
|
||||
|
@ -389,11 +389,12 @@ class ExplicitDelegateLikeDataFlowCall extends DelegateDataFlowCall, TExplicitDe
|
|||
*/
|
||||
class TransitiveCapturedDataFlowCall extends DataFlowCall, TTransitiveCapturedCall {
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
private Callable target;
|
||||
|
||||
TransitiveCapturedDataFlowCall() { this = TTransitiveCapturedCall(cfn, target) }
|
||||
TransitiveCapturedDataFlowCall() { this = TTransitiveCapturedCall(cfn) }
|
||||
|
||||
override DataFlowCallable getARuntimeTarget() { result.asCallable() = target }
|
||||
override DataFlowCallable getARuntimeTarget() {
|
||||
transitiveCapturedCallTarget(cfn, result.asCallable())
|
||||
}
|
||||
|
||||
override ControlFlow::Nodes::ElementNode getControlFlowNode() { result = cfn }
|
||||
|
||||
|
|
|
@ -1564,7 +1564,7 @@ private module OutNodes {
|
|||
additionalCalls = false and call = csharpCall(_, cfn)
|
||||
or
|
||||
additionalCalls = true and
|
||||
call = TTransitiveCapturedCall(cfn, n.getEnclosingCallable())
|
||||
call = TTransitiveCapturedCall(cfn)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче