mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Merge pull request #7518 from tausbn/python-extend-unreachable-statement-test
Python: Extend unreachable statement test
This commit is contained in:
10
python/ql/test/query-tests/Statements/unreachable/global.py
Normal file
10
python/ql/test/query-tests/Statements/unreachable/global.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# FP involving global variables modified in a different scope
|
||||
|
||||
i = 0
|
||||
def update_i():
|
||||
global i
|
||||
i = i + 1
|
||||
|
||||
update_i()
|
||||
if i > 0:
|
||||
print("i is greater than 0") # FP: This is reachable
|
||||
Reference in New Issue
Block a user