mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Warn on using shift instructions
This commit is contained in:
parent
9e0446a22c
commit
468d0f6199
@ -548,6 +548,22 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
|
|||||||
"the Metropolis hard fork. Before that it acts as an invalid instruction."
|
"the Metropolis hard fork. Before that it acts as an invalid instruction."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static set<solidity::Instruction> experimentalInstructions{
|
||||||
|
solidity::Instruction::SHL,
|
||||||
|
solidity::Instruction::SHR,
|
||||||
|
solidity::Instruction::SAR,
|
||||||
|
solidity::Instruction::ROL,
|
||||||
|
solidity::Instruction::ROR
|
||||||
|
};
|
||||||
|
if (experimentalInstructions.count(_instr))
|
||||||
|
m_errorReporter.warning(
|
||||||
|
_location,
|
||||||
|
"The \"" +
|
||||||
|
boost::to_lower_copy(instructionInfo(_instr).name)
|
||||||
|
+ "\" instruction is only available after " +
|
||||||
|
"the Constantinople hard fork. Before that it acts as an invalid instruction."
|
||||||
|
);
|
||||||
|
|
||||||
if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI || _instr == solidity::Instruction::JUMPDEST)
|
if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI || _instr == solidity::Instruction::JUMPDEST)
|
||||||
m_errorReporter.warning(
|
m_errorReporter.warning(
|
||||||
_location,
|
_location,
|
||||||
|
Loading…
Reference in New Issue
Block a user