Add another argument to setimmutable and the AssignImmutable opcode, allowing to modify code at any memory offset.

This commit is contained in:
Daniel Kirchner
2020-10-15 18:14:41 +02:00
parent 00fb152316
commit 0dca223b45
12 changed files with 58 additions and 32 deletions
+3
View File
@@ -203,7 +203,10 @@ size_t ContractCompiler::packIntoContractCreator(ContractDefinition const& _cont
{
auto slotNames = m_context.immutableVariableSlotNames(*immutable);
for (auto&& slotName: slotNames | boost::adaptors::reversed)
{
m_context << u256(0);
m_context.appendImmutableAssignment(slotName);
}
}
if (!immutables.empty())
m_context.pushSubroutineSize(m_context.runtimeSub());