Merge pull request #161 from trailofbits/dev-legacy-usertypename-parsing

Fix UserDefinedTypeName type parsing from names
pull/179/head
Feist Josselin 6 years ago committed by GitHub
commit 6bad498509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      slither/solc_parsing/solidity_types/type_parsing.py

@ -160,7 +160,10 @@ def parse_type(t, caller_context):
elif t[key] == 'UserDefinedTypeName':
if is_compact_ast:
return _find_from_type_name(t['typeDescriptions']['typeString'], contract, contracts, structures, enums)
return _find_from_type_name(t['attributes'][key], contract, contracts, structures, enums)
# Determine if we have a type node (otherwise we use the name node, as some older solc did not have 'type').
type_name_key = 'type' if 'type' in t['attributes'] else key
return _find_from_type_name(t['attributes'][type_name_key], contract, contracts, structures, enums)
elif t[key] == 'ArrayTypeName':
length = None

Loading…
Cancel
Save