aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-12-05 18:44:28 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-12-06 03:27:12 +0800
commitbc875f6b9c140d351ec8ae96d2c8e29979017d57 (patch)
tree8e8fc06a59cf7e6aebe26f95cbf03a95eff6766b /libsolidity/inlineasm
parent37b66616fbee4301f6573cd62c6b581481d9787a (diff)
downloaddexon-solidity-bc875f6b9c140d351ec8ae96d2c8e29979017d57.tar.gz
dexon-solidity-bc875f6b9c140d351ec8ae96d2c8e29979017d57.tar.zst
dexon-solidity-bc875f6b9c140d351ec8ae96d2c8e29979017d57.zip
Warn for assembly labels too
Diffstat (limited to 'libsolidity/inlineasm')
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp
index 5c03342d..04b8417f 100644
--- a/libsolidity/inlineasm/AsmAnalysis.cpp
+++ b/libsolidity/inlineasm/AsmAnalysis.cpp
@@ -56,6 +56,7 @@ bool AsmAnalyzer::operator()(Label const& _label)
{
solAssert(!m_julia, "");
m_info.stackHeightInfo[&_label] = m_stackHeight;
+ warnOnInstructions(solidity::Instruction::JUMPDEST, _label.location);
return true;
}
@@ -523,10 +524,10 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
"the Metropolis hard fork. Before that it acts as an invalid instruction."
);
- if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI)
+ if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI || _instr == solidity::Instruction::JUMPDEST)
m_errorReporter.warning(
_location,
- "Jump instructions are low-level EVM features that can lead to "
+ "Jump instructions and labels are low-level EVM features that can lead to "
"incorrect stack access. Because of that they are discouraged. "
"Please consider using \"switch\" or \"for\" statements instead."
);