Split MovableChecker and introduce SideEffectsUpToMSize.

This commit is contained in:
chriseth
2019-05-28 12:54:32 +02:00
parent b95eebee1c
commit afe887adc1
7 changed files with 124 additions and 60 deletions
+8 -13
View File
@@ -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)