mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Python: Fix tests by managing local sources
`API::Node::getAwaited` is restriced to local sources
This commit is contained in:
@@ -175,6 +175,19 @@ module EssaFlow {
|
||||
contextManager.strictlyDominates(var)
|
||||
)
|
||||
or
|
||||
// Async with var definition
|
||||
// `async with f(42) as x:`
|
||||
// nodeFrom is `x`, cfg node
|
||||
// nodeTo is `x`, essa var
|
||||
//
|
||||
// This makes the cfg node the local source of the awaited value.
|
||||
exists(With with, ControlFlowNode var |
|
||||
nodeFrom.(CfgNode).getNode() = var and
|
||||
nodeTo.(EssaNode).getVar().getDefinition().(WithDefinition).getDefiningNode() = var and
|
||||
with.getOptionalVars() = var.getNode() and
|
||||
with.isAsync()
|
||||
)
|
||||
or
|
||||
// Parameter definition
|
||||
// `def foo(x):`
|
||||
// nodeFrom is `x`, cfgNode
|
||||
|
||||
Reference in New Issue
Block a user