From 55e41b602adbde79bc03c1ba9bea2e7f1c029201 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 3 Jul 2020 18:01:07 +0100 Subject: [PATCH] Explicitly check for jump instructions in EVMDialect --- libyul/backends/evm/EVMDialect.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index 602b6c8ff..bf0c63bfa 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -114,12 +114,15 @@ pair createFunction( map createBuiltins(langutil::EVMVersion _evmVersion, bool _objectAccess) { map builtins; + // NOTE: Parser::instructions() will filter JUMPDEST and PUSHnn too for (auto const& instr: Parser::instructions()) if ( !evmasm::isDupInstruction(instr.second) && !evmasm::isSwapInstruction(instr.second) && + !evmasm::isPushInstruction(instr.second) && instr.second != evmasm::Instruction::JUMP && instr.second != evmasm::Instruction::JUMPI && + instr.second != evmasm::Instruction::JUMPDEST && _evmVersion.hasOpcode(instr.second) ) builtins.emplace(createEVMFunction(instr.first, instr.second));