Properly offset jumpdests

This commit is contained in:
Alex Beregszaszi
2022-12-05 20:17:55 +01:00
committed by Rodrigo Q. Saramago
parent ab2f46639c
commit 8d62b96b2c
+1 -1
View File
@@ -680,7 +680,7 @@ LinkerObject const& Assembly::assemble(bool eof) const
size_t tagId = static_cast<size_t>(i.data());
assertThrow(ret.bytecode.size() < 0xffffffffL, AssemblyException, "Tag too large.");
assertThrow(m_tagPositionsInBytecode[tagId] == numeric_limits<size_t>::max(), AssemblyException, "Duplicate tag position.");
m_tagPositionsInBytecode[tagId] = ret.bytecode.size();
m_tagPositionsInBytecode[tagId] = ret.bytecode.size() - codeStart;
ret.bytecode.push_back(static_cast<uint8_t>(Instruction::JUMPDEST));
break;
}