diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 7d4ab0857..39f3fc683 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -833,6 +833,10 @@ class FunctionSolc(Function): for node in self.nodes: node.analyze_expressions(self) + self._filter_ternary() + self._remove_alone_endif() + + def _filter_ternary(self): ternary_found = True while ternary_found: ternary_found = False @@ -847,7 +851,6 @@ class FunctionSolc(Function): self.split_ternary_node(node, condition, true_expr, false_expr) ternary_found = True break - self._remove_alone_endif() def get_last_ssa_state_variables_instances(self): if not self.is_implemented: diff --git a/slither/solc_parsing/declarations/modifier.py b/slither/solc_parsing/declarations/modifier.py index a62eb8902..5e2748c4e 100644 --- a/slither/solc_parsing/declarations/modifier.py +++ b/slither/solc_parsing/declarations/modifier.py @@ -59,6 +59,9 @@ class ModifierSolc(Modifier, FunctionSolc): for node in self.nodes: node.analyze_expressions(self) + self._filter_ternary() + self._remove_alone_endif() + self._analyze_read_write() self._analyze_calls()