Skip to content

Commit

Permalink
fix #1748
Browse files Browse the repository at this point in the history
  • Loading branch information
Troublor committed Mar 16, 2023
1 parent 547a804 commit 6eab0b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions slither/visitors/slithir/expression_to_slithir.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ def _post_assignement_operation(self, expression: AssignmentOperation) -> None:
operation.set_expression(expression)
self._result.append(operation)
set_val(expression, left)
elif isinstance(left.type, ArrayType):
# Special case for init of array, when the right has only one element
operation = InitArray([right], left)
operation.set_expression(expression)
self._result.append(operation)
set_val(expression, left)
else:
operation = convert_assignment(
left, right, expression.type, expression.expression_return_type
Expand Down

0 comments on commit 6eab0b2

Please sign in to comment.