From aeb58ee5b970f2263a5508821f7f9a3132893d1c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 3 Dec 2022 14:03:39 +0100 Subject: [PATCH] Properly offset jumpdests --- libevmasm/Assembly.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index f1c239574..45b95d552 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -680,7 +680,7 @@ LinkerObject const& Assembly::assemble(bool eof) const size_t tagId = static_cast(i.data()); assertThrow(ret.bytecode.size() < 0xffffffffL, AssemblyException, "Tag too large."); assertThrow(m_tagPositionsInBytecode[tagId] == numeric_limits::max(), AssemblyException, "Duplicate tag position."); - m_tagPositionsInBytecode[tagId] = ret.bytecode.size(); + m_tagPositionsInBytecode[tagId] = ret.bytecode.size() - codeStart; ret.bytecode.push_back(static_cast(Instruction::JUMPDEST)); break; }