Skip to content

Commit 5d053f2

Browse files
committed
more useful comments on fix
1 parent b902653 commit 5d053f2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

slither/slithir/convert.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,18 @@ def _find_function_from_parameter(
219219
type_args: List[str]
220220
for idx, arg in enumerate(arguments):
221221
if isinstance(arg, (list,)):
222+
# If the argument is an array literal (list of IR variables), the type is a fixed array.
223+
# We resolve the complete fixed array type here (e.g., 'struct B[2]') and store it in type_args.
222224
type_args = [f"{get_type(arg[0].type)}[{len(arg)}]"]
223225
elif isinstance(arg, Function):
224226
type_args = [arg.signature_str]
225227
else:
226228
type_args = [get_type(arg.type)]
227229

228-
# if an array was instantiated in the function call, we'll get a list of types
229-
# hence we can skip the conversion check
230+
# --- Array Instantiation Guard ---
231+
# If the argument was an array literal (list), its type was definitively resolved above.
232+
# We must skip the subsequent logic, which attempts implicit type conversions
233+
# designed only for single ElementaryTypes (uint/int/bytes).
230234
if not isinstance(arg, (list,)):
231235
arg_type = arg.type
232236
if isinstance(

0 commit comments

Comments
 (0)