Merge pull request #576 from crytic/dev-fix-structure-to-list-conversion

Fix incorrect types to list conversion
pull/598/head
Feist Josselin 4 years ago committed by GitHub
commit 1ebf43ce72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      slither/slithir/convert.py

@ -1040,6 +1040,29 @@ def _convert_to_structure_to_list(return_type: Type) -> List[Type]:
for v in return_type.type.elems_ordered:
ret += _convert_to_structure_to_list(v.type)
return ret
# Mapping and arrays are not included in external call
#
# contract A{
#
# struct St{
# uint a;
# uint b;
# mapping(uint => uint) map;
# uint[] array;
# }
#
# mapping (uint => St) public st;
#
# }
#
# contract B{
#
# function f(A a) public{
# (uint a, uint b) = a.st(0);
# }
# }
if isinstance(return_type, (MappingType, ArrayType)):
return []
return [return_type.type]

Loading…
Cancel
Save