From af126f6dae44093c7f40b66753b193082626bdeb Mon Sep 17 00:00:00 2001 From: Kirk Baird Date: Mon, 8 Feb 2021 14:34:19 +1100 Subject: [PATCH] Fix non-push instructions Signed-off-by: Kirk Baird --- brownie/project/compiler/solidity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/solidity.py b/brownie/project/compiler/solidity.py index 62ca3ff81..32bbf46f0 100644 --- a/brownie/project/compiler/solidity.py +++ b/brownie/project/compiler/solidity.py @@ -463,7 +463,7 @@ def _generate_coverage_data( # necessary because sometimes solidity returns an incomplete source map pc_list.append({"op": opcodes.popleft(), "pc": pc}) pc += 1 - if opcodes and opcodes[0][:2] == "0x": + if pc_list[-1]["op"].startswith("PUSH") and opcodes[0][:2] == "0x": pc_list[-1]["value"] = opcodes.popleft() pc += int(pc_list[-1]["op"][4:])