From 36a1af528ba721c3eebfe1755aa1ccd8bd368f05 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 16 Mar 2020 14:53:52 +0100 Subject: [PATCH] Fix incorrect variable assignment in _parse_modifier, add Nop in copy_ir --- slither/slithir/utils/ssa.py | 4 +++- slither/solc_parsing/declarations/function.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/slither/slithir/utils/ssa.py b/slither/slithir/utils/ssa.py index 4049e5cab..cc25944d2 100644 --- a/slither/slithir/utils/ssa.py +++ b/slither/slithir/utils/ssa.py @@ -17,7 +17,7 @@ from slither.slithir.operations import (Assignment, Balance, Binary, Condition, OperationWithLValue, Phi, PhiCallback, Push, Return, Send, SolidityCall, Transfer, TypeConversion, Unary, - Unpack) + Unpack, Nop) from slither.slithir.variables import (Constant, LocalIRVariable, ReferenceVariable, ReferenceVariableSSA, StateIRVariable, TemporaryVariable, @@ -620,6 +620,8 @@ def copy_ir(ir, *instances): new_ir = NewStructure(structure, lvalue) new_ir.arguments = get_arguments(ir, *instances) return new_ir + elif isinstance(ir, Nop): + return Nop() elif isinstance(ir, Push): array = get_variable(ir, lambda x: x.array, *instances) lvalue = get_variable(ir, lambda x: x.lvalue, *instances) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 60a78c5dd..2f7d7563b 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -928,7 +928,6 @@ class FunctionSolc(Function): else: latest_entry_point = self.entry_point insert_node(latest_entry_point, node) - node = latest_entry_point self._explicit_base_constructor_calls.append(ModifierStatements(modifier=m, entry_point=latest_entry_point, nodes=[latest_entry_point, node]))