File tree Expand file tree Collapse file tree 2 files changed +1
-2
lines changed
test/query-tests/Variables/undefined Expand file tree Collapse file tree 2 files changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import Undefined
15
15
import semmle.python.pointsto.PointsTo
16
16
17
17
predicate uninitialized_local ( NameNode use ) {
18
- exists ( FastLocalVariable local | use .uses ( local ) or use .deletes ( local ) | not local .escapes ( ) ) and
18
+ exists ( FastLocalVariable local | use .uses ( local ) or use .deletes ( local ) | not local .escapes ( ) and not local = any ( Nonlocal nl ) . getAVariable ( ) ) and
19
19
(
20
20
any ( Uninitialized uninit ) .taints ( use ) and
21
21
PointsToInternal:: reachableBlock ( use .getBasicBlock ( ) , _)
Original file line number Diff line number Diff line change 11
11
| UninitializedLocal.py:163:7:163:7 | x | Local variable 'x' may be used before it is initialized. |
12
12
| UninitializedLocal.py:176:16:176:16 | x | Local variable 'x' may be used before it is initialized. |
13
13
| UninitializedLocal.py:178:16:178:16 | y | Local variable 'y' may be used before it is initialized. |
14
- | captured.py:8:15:8:17 | foo | Local variable 'foo' may be used before it is initialized. |
15
14
| odasa3987.py:11:8:11:10 | var | Local variable 'var' may be used before it is initialized. |
You can’t perform that action at this time.
0 commit comments