Skip to content

Commit 5d4db3a

Browse files
authored
Python: Extend unreachable statement test
Adds a test demostrating the false positive observed by andersfugmann. Note that this does not change the `.expected` file, and so the tests will fail. This is expected.
1 parent bf0ecde commit 5d4db3a

File tree

1 file changed

+10
-0
lines changed
  • python/ql/test/query-tests/Statements/unreachable

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# FP involving global variables modified in a different scope
2+
3+
i = 0
4+
def update_i():
5+
global i
6+
i = i + 1
7+
8+
update_i()
9+
if i > 0:
10+
print("i is greater than 0") # FP: This is reachable

0 commit comments

Comments
 (0)