From c2b9bd7cb09e1118d1a931c698b17c7a2c8dcefb Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 7 Mar 2019 11:40:39 +0530 Subject: [PATCH] Move a test to TODO --- mythril/laser/ethereum/svm.py | 13 +++++++------ tests/laser/evm_testsuite/evm_test.py | 8 ++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index b7c05041..a4866eee 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -412,8 +412,6 @@ class LaserEVM: :param opcode: :param new_states: """ - if not self.requires_statespace: - return if opcode == "JUMP": assert len(new_states) <= 1 for state in new_states: @@ -461,10 +459,13 @@ class LaserEVM: old_node = state.node state.node = new_node new_node.constraints = state.mstate.constraints - self.nodes[new_node.uid] = new_node - self.edges.append( - Edge(old_node.uid, new_node.uid, edge_type=edge_type, condition=condition) - ) + if self.requires_statespace: + self.nodes[new_node.uid] = new_node + self.edges.append( + Edge( + old_node.uid, new_node.uid, edge_type=edge_type, condition=condition + ) + ) if edge_type == JumpType.RETURN: new_node.flags |= NodeFlags.CALL_RETURN diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 9b415826..24bbcba2 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -31,6 +31,7 @@ test_types = [ tests_with_gas_support = ["gas0", "gas1"] tests_with_block_number_support = [ "BlockNumberDynamicJumpi0", + "BlockNumberDynamicJumpi1", "BlockNumberDynamicJump0_jumpdest2", "DynamicJumpPathologicalTest0", "BlockNumberDynamicJumpifInsidePushWithJumpDest", @@ -42,8 +43,11 @@ tests_with_block_number_support = [ "DynamicJumpJD_DependsOnJumps1", ] tests_with_log_support = ["log1MemExp"] -tests_not_relevent = ["loop_stacklimit_1020", "loop_stacklimit_1021"] -tests_to_resolve = ["jumpTo1InstructionafterJump", "sstore_load_2"] +tests_not_relevent = [ + "loop_stacklimit_1020", # We won't be looping till 1020 as we have a max_depth + "loop_stacklimit_1021", +] +tests_to_resolve = ["jumpTo1InstructionafterJump", "sstore_load_2", "jumpi_at_the_end"] ignored_test_names = ( tests_with_gas_support + tests_with_log_support