mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Split MovableChecker and introduce SideEffectsUpToMSize.
This commit is contained in:
@@ -213,20 +213,15 @@ bool SemanticInformation::sideEffectFree(Instruction _instruction)
|
||||
// These are not really functional.
|
||||
assertThrow(!isDupInstruction(_instruction) && !isSwapInstruction(_instruction), AssemblyException, "");
|
||||
|
||||
InstructionInfo info = instructionInfo(_instruction);
|
||||
switch (_instruction)
|
||||
{
|
||||
// All the instructions that merely read memory are fine
|
||||
// even though they are marked "sideEffects" in Instructions.cpp
|
||||
case Instruction::KECCAK256:
|
||||
case Instruction::MLOAD:
|
||||
return !instructionInfo(_instruction).sideEffects;
|
||||
}
|
||||
|
||||
bool SemanticInformation::sideEffectFreeIfNoMSize(Instruction _instruction)
|
||||
{
|
||||
if (_instruction == Instruction::KECCAK256 || _instruction == Instruction::MLOAD)
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (info.sideEffects)
|
||||
return false;
|
||||
return true;
|
||||
else
|
||||
return sideEffectFree(_instruction);
|
||||
}
|
||||
|
||||
bool SemanticInformation::invalidatesMemory(Instruction _instruction)
|
||||
|
||||
Reference in New Issue
Block a user