Merge pull request #442 from crytic/dev-empty-catch

Fix parsing of empty catch statement
pull/445/head
Feist Josselin 5 years ago committed by GitHub
commit ff8066e607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      slither/solc_parsing/declarations/function.py

@ -511,6 +511,7 @@ class FunctionSolc(Function):
def _parse_catch(self, statement, node):
block = statement.get('block', None)
if block is None:
raise ParsingError('Catch not correctly parsed by Slither %s' % statement)
try_node = self._new_node(NodeType.CATCH, statement['src'])
@ -521,9 +522,10 @@ class FunctionSolc(Function):
else:
params = statement[self.get_children('children')]
for param in params.get('parameters', []):
assert param[self.get_key()] == 'VariableDeclaration'
self._add_param(param)
if params:
for param in params.get('parameters', []):
assert param[self.get_key()] == 'VariableDeclaration'
self._add_param(param)
return self._parse_statement(block, try_node)

Loading…
Cancel
Save