aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-27 21:47:07 +0800
committerGitHub <noreply@github.com>2018-02-27 21:47:07 +0800
commit2abc5be7e628c18562f1df546137fcb0748ecbb2 (patch)
treec4e1ed226c84414bbc9ed971aae79ed8f81bac9c /libsolidity
parent6512bfbcea2fb76145b2163c9962599c2f09e0b9 (diff)
parent73c5d99bfaa4d17a97d4554a89d1005b25e62f98 (diff)
downloaddexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.tar.gz
dexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.tar.zst
dexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.zip
Merge pull request #2541 from ethereum/asm-bitshift
Add bit shifting opcodes (EIP145)
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp
index a05ac57d..1030523a 100644
--- a/libsolidity/inlineasm/AsmAnalysis.cpp
+++ b/libsolidity/inlineasm/AsmAnalysis.cpp
@@ -548,6 +548,20 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
"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
+ };
+ 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)
m_errorReporter.warning(
_location,