Skip to content

Commit 456f60e

Browse files
committed
reformat with black
1 parent b70a8e1 commit 456f60e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

slither/detectors/compiler_bugs/array_by_reference.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ def get_funcs_modifying_array_params(contracts: List[Contract]) -> Set[FunctionC
8585
# Determine if this function takes an array as a parameter and the location isn't storage.
8686
# If it has been written to, we know this sets an non-storage-ref array.
8787
for param in function.parameters:
88-
if isinstance(param.type, ArrayType) and param.location != VariableLocation.STORAGE:
88+
if (
89+
isinstance(param.type, ArrayType)
90+
and param.location != VariableLocation.STORAGE
91+
):
8992
if param in function.variables_written:
9093
results.add(function)
9194
break
@@ -133,8 +136,14 @@ def detect_calls_passing_ref_to_function(
133136
# If it is a state variable OR a local variable referencing storage, we add it to the list.
134137
if (
135138
isinstance(arg, StateVariable)
136-
or (isinstance(arg, LocalVariable) and arg.location == VariableLocation.STORAGE)
137-
) and (isinstance(param.type, ArrayType) and param.location != VariableLocation.STORAGE):
139+
or (
140+
isinstance(arg, LocalVariable)
141+
and arg.location == VariableLocation.STORAGE
142+
)
143+
) and (
144+
isinstance(param.type, ArrayType)
145+
and param.location != VariableLocation.STORAGE
146+
):
138147
results.append((ir.node, arg, ir.function))
139148
return results
140149

0 commit comments

Comments
 (0)