Merge pull request #563 from crytic/dev-fix-tuple-reassignement

Fix incorrect handling of tuple variable re-assignement
pull/565/head
Feist Josselin 4 years ago committed by GitHub
commit c01984f80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      slither/visitors/slithir/expression_to_slithir.py

@ -134,7 +134,7 @@ class ExpressionToSlithIR(ExpressionVisitor):
# Tuple with only one element. We need to convert the assignment to a Unpack # Tuple with only one element. We need to convert the assignment to a Unpack
# Ex: # Ex:
# (uint a,,) = g() # (uint a,,) = g()
elif isinstance(left, LocalVariableInitFromTuple) and left.tuple_index: elif isinstance(left, LocalVariableInitFromTuple) and left.tuple_index and isinstance(right, TupleVariable):
operation = Unpack(left, right, left.tuple_index) operation = Unpack(left, right, left.tuple_index)
operation.set_expression(expression) operation.set_expression(expression)
self._result.append(operation) self._result.append(operation)

Loading…
Cancel
Save