mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
This commit is contained in:
@@ -18,9 +18,9 @@ print(unreferenced_g)
|
||||
# Modification by reassignment
|
||||
|
||||
g_mod = []
|
||||
# Immediate reassignment -- no modification possible.
|
||||
# The following assignment should not be a `ModuleVariableNode`, but currently our analysis thinks `g_mod` might be used in the `print` call
|
||||
g_mod = [10] # $f+:writes=g_mod
|
||||
print(g_mod) # Could potentially be redefined here.
|
||||
print("foo")
|
||||
g_mod = [100] # $writes=g_mod
|
||||
|
||||
# Modification by mutation
|
||||
@@ -37,7 +37,7 @@ if unknown_module.attr:
|
||||
else:
|
||||
g_mult = [300] # $writes=g_mult
|
||||
|
||||
# Potential reassignment
|
||||
# A global with multiple potential definitions
|
||||
|
||||
g_mult2 = [400] # $writes=g_mult2
|
||||
if unknown_module.attr:
|
||||
|
||||
Reference in New Issue
Block a user