Parse local variables prior parsing modifier (fix 99)

pull/108/head
Josselin 6 years ago
parent f70fe60b1d
commit a4032dc000
  1. 11
      slither/solc_parsing/declarations/function.py

@ -804,11 +804,12 @@ class FunctionSolc(Function):
if child[self.get_key()] == 'Block':
self._is_implemented = True
self._parse_cfg(child)
continue
assert child[self.get_key()] == 'ModifierInvocation'
self._parse_modifier(child)
# Parse modifier after parsing all the block
# In the case a local variable is used in the modifier
for child in children[2:]:
if child[self.get_key()] == 'ModifierInvocation':
self._parse_modifier(child)
for local_vars in self.variables:
local_vars.analyze(self)

Loading…
Cancel
Save