mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Capture flow: Take overwrites in nested scopes into account
This commit is contained in:
@@ -453,6 +453,10 @@ module VariableCapture {
|
||||
Flow::localFlowStep(asClosureNode(node1), asClosureNode(node2))
|
||||
}
|
||||
|
||||
predicate clearsContent(Node node, Content::CapturedVariableContent c) {
|
||||
Flow::clearsContent(asClosureNode(node), c.getVariable())
|
||||
}
|
||||
|
||||
class CapturedSsaDefinitionExt extends SsaImpl::DefinitionExt {
|
||||
CapturedSsaDefinitionExt() { this.getSourceVariable() instanceof CapturedVariable }
|
||||
}
|
||||
@@ -1930,6 +1934,8 @@ predicate clearsContent(Node n, ContentSet c) {
|
||||
c.isKnownOrUnknownElement(TKnownElementContent(cv)) and
|
||||
cv.isSymbol(name)
|
||||
)
|
||||
or
|
||||
VariableCapture::clearsContent(n, any(Content::CapturedVariableContent v | c.isSingleton(v)))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user