diff options
author | chriseth <c@ethdev.com> | 2017-02-23 19:56:37 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-03-03 22:41:02 +0800 |
commit | 41236cd08c292dba428fa1ae57126fb4ec7e901d (patch) | |
tree | ed2e3a922db05ae25f4b31624194e4683cd89adc /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | c85f9257f87bb8d6f84a4a74a9b290d7207eebd7 (diff) | |
download | dexon-solidity-41236cd08c292dba428fa1ae57126fb4ec7e901d.tar.gz dexon-solidity-41236cd08c292dba428fa1ae57126fb4ec7e901d.tar.zst dexon-solidity-41236cd08c292dba428fa1ae57126fb4ec7e901d.zip |
Slightly cleaner label ids.
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 9e53fc4a..a21c50d1 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -36,15 +36,14 @@ using namespace dev::solidity; using namespace dev::solidity::assembly; -bool Scope::registerLabel(string const& _name, size_t _id) +bool Scope::registerLabel(string const& _name) { if (exists(_name)) return false; - identifiers[_name] = Scope::Label(_id); + identifiers[_name] = Label(); return true; } - bool Scope::registerVariable(string const& _name) { if (exists(_name)) @@ -86,7 +85,9 @@ AsmAnalyzer::AsmAnalyzer(AsmAnalyzer::Scopes& _scopes, ErrorList& _errors): { // Make the Solidity ErrorTag available to inline assembly m_scopes[nullptr] = make_shared<Scope>(); - m_scopes[nullptr]->identifiers["invalidJumpLabel"] = Scope::Label(Scope::Label::errorLabelId); + Scope::Label errorLabel; + errorLabel.id = Scope::Label::errorLabelId; + m_scopes[nullptr]->identifiers["invalidJumpLabel"] = errorLabel; m_currentScope = m_scopes[nullptr].get(); } @@ -116,7 +117,7 @@ bool AsmAnalyzer::operator()(FunctionalInstruction const& _instr) bool AsmAnalyzer::operator()(Label const& _item) { - if (!m_currentScope->registerLabel(_item.name, Scope::Label::unassignedLabelId)) + if (!m_currentScope->registerLabel(_item.name)) { //@TODO secondary location m_errors.push_back(make_shared<Error>( |