Skip to content

Commit

Permalink
Merge pull request #550 from crytic/dev-array-slices
Browse files Browse the repository at this point in the history
Temporary support for array slices
  • Loading branch information
montyly authored Jul 22, 2020
2 parents 1b005ef + 26ca40b commit 8ee5614
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions slither/solc_parsing/expressions/expression_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,4 +763,13 @@ def parse_expression(expression: Dict, caller_context: CallerContext) -> "Expres
call.set_offset(src, caller_context.slither)
return call

elif name == "IndexRangeAccess":
# For now, we convert array slices to a direct array access
# As a result the generated IR will lose the slices information
# As far as I understand, array slice are only used in abi.decode
# https://solidity.readthedocs.io/en/v0.6.12/types.html
# TODO: Investigate array slices usage and implication for the IR
base = parse_expression(expression["baseExpression"], caller_context)
return base

raise ParsingError("Expression not parsed %s" % name)

0 comments on commit 8ee5614

Please sign in to comment.