Merge pull request #536 from crytic/dev-tuples-types

Improve type support for tuple
pull/538/head
Feist Josselin 4 years ago committed by GitHub
commit c857bf88fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      slither/visitors/slithir/expression_to_slithir.py

@ -115,11 +115,14 @@ class ExpressionToSlithIR(ExpressionVisitor):
set_val(expression, None) set_val(expression, None)
else: else:
assert isinstance(right, TupleVariable) assert isinstance(right, TupleVariable)
tuple_types = []
for idx in range(len(left)): for idx in range(len(left)):
if not left[idx] is None: if not left[idx] is None:
operation = Unpack(left[idx], right, idx) operation = Unpack(left[idx], right, idx)
operation.set_expression(expression) operation.set_expression(expression)
tuple_types.append(left[idx].type)
self._result.append(operation) self._result.append(operation)
right.set_type(tuple_types)
set_val(expression, None) set_val(expression, None)
else: else:
# Init of array, like # Init of array, like

Loading…
Cancel
Save