Apply early analysis of cst state variables

pull/56/head
Josselin 6 years ago
parent 16aa6c5ac5
commit a59d812635
  1. 6
      slither/solc_parsing/declarations/contract.py
  2. 5
      slither/solc_parsing/slitherSolc.py

@ -189,6 +189,12 @@ class ContractSolc04(Contract):
self._variables[var.name] = var
def analyze_constant_state_variables(self):
for var in self.variables:
if var.is_constant:
var.analyze(self)
return
def analyze_state_variables(self):
for var in self.variables:
var.analyze(self)

@ -215,6 +215,9 @@ class SlitherSolc(Slither):
contract.set_is_analyzed(True)
def _analyze_struct_events(self, contract):
contract.analyze_constant_state_variables()
# Struct can refer to enum, or state variables
contract.analyze_structs()
# Event can refer to struct
@ -236,7 +239,7 @@ class SlitherSolc(Slither):
contract.analyze_content_functions()
contract.set_is_analyzed(True)
def _convert_to_slithir(self):
for contract in self.contracts:
for func in contract.functions + contract.modifiers:

Loading…
Cancel
Save