mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
python: exclude nonlocals from query
This commit is contained in:
@@ -15,7 +15,7 @@ import Undefined
|
||||
import semmle.python.pointsto.PointsTo
|
||||
|
||||
predicate uninitialized_local(NameNode use) {
|
||||
exists(FastLocalVariable local | use.uses(local) or use.deletes(local) | not local.escapes()) and
|
||||
exists(FastLocalVariable local | use.uses(local) or use.deletes(local) | not local.escapes() and not local = any(Nonlocal nl).getAVariable()) and
|
||||
(
|
||||
any(Uninitialized uninit).taints(use) and
|
||||
PointsToInternal::reachableBlock(use.getBasicBlock(), _)
|
||||
|
||||
Reference in New Issue
Block a user