From 01724da877971027ea82a080a8e202c20bea69c0 Mon Sep 17 00:00:00 2001 From: e-ngo Date: Tue, 20 Aug 2019 00:29:46 -0700 Subject: [PATCH] Added new calculation to codesize. --- mythril/laser/ethereum/instructions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 5d2b9e93..1895eefe 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -902,7 +902,8 @@ class Instruction: state = global_state.mstate environment = global_state.environment disassembly = environment.code - state.stack.append(len(disassembly.bytecode) // 2) + no_of_bytes = min(len(disassembly.bytecode) / 2, 320) + (len(disassembly.bytecode) / 2) + state.stack.append(no_of_bytes) return [global_state] @StateTransition(enable_gas=False)