Skip to content

Commit 8372513

Browse files
committed
Warn on using shift instructions
1 parent 9f29771 commit 8372513

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libsolidity/inlineasm/AsmAnalysis.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,21 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
486486
"the Metropolis hard fork. Before that it acts as an invalid instruction."
487487
);
488488

489+
static set<solidity::Instruction> experimentalInstructions{
490+
solidity::Instruction::SHL,
491+
solidity::Instruction::SHR,
492+
solidity::Instruction::SAR,
493+
solidity::Instruction::ROL,
494+
solidity::Instruction::ROR
495+
};
496+
if (experimentalInstructions.count(_instr))
497+
m_errorReporter.warning(
498+
_location,
499+
"The \"" +
500+
boost::to_lower_copy(instructionInfo(_instr).name)
501+
+ "\" instruction is experimental and not available in regular clients. "
502+
);
503+
489504
if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI)
490505
m_errorReporter.warning(
491506
_location,

0 commit comments

Comments
 (0)