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
+5 -1
View File
@@ -93,9 +93,13 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool
// can be ignored
}
else if (_item.type() == AssignImmutable)
{
// Since AssignImmutable breaks blocks, it should be fine to only consider its changes to the stack, which
// is the same as POP.
// is the same as two POPs.
// Note that the StoreOperation for POP is generic and _copyItem is ignored.
feedItem(AssemblyItem(Instruction::POP), _copyItem);
return feedItem(AssemblyItem(Instruction::POP), _copyItem);
}
else if (_item.type() != Operation)
{
assertThrow(_item.deposit() == 1, InvalidDeposit, "");