mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add another argument to setimmutable and the AssignImmutable opcode, allowing to modify code at any memory offset.
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -558,7 +558,7 @@ string IRGenerator::deployCode(ContractDefinition const& _contract)
|
||||
codecopy(0, dataoffset("<object>"), datasize("<object>"))
|
||||
|
||||
<#storeImmutables>
|
||||
setimmutable("<immutableName>", <var>)
|
||||
setimmutable(0, "<immutableName>", <var>)
|
||||
</storeImmutables>
|
||||
|
||||
return(0, datasize("<object>"))
|
||||
|
||||
Reference in New Issue
Block a user