aboutsummaryrefslogtreecommitdiffstats
path: root/NameAndTypeResolver.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-17 23:23:18 +0800
committerChristian <c@ethdev.com>2014-12-17 23:24:56 +0800
commit5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a (patch)
tree3aaf794ca4352fedfb7b651a5722b3ff2a588e1b /NameAndTypeResolver.cpp
parent3d98ec1323f604130c0dba87ce4596f04ffa0269 (diff)
downloaddexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.gz
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.bz2
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.lz
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.xz
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.zst
dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.zip
Assertions that throw InternalCompilerErrors.
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r--NameAndTypeResolver.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp
index 80732615..3774537d 100644
--- a/NameAndTypeResolver.cpp
+++ b/NameAndTypeResolver.cpp
@@ -70,8 +70,7 @@ void NameAndTypeResolver::checkTypeRequirements(ContractDefinition& _contract)
void NameAndTypeResolver::updateDeclaration(Declaration const& _declaration)
{
m_scopes[nullptr].registerDeclaration(_declaration, true);
- if (asserts(_declaration.getScope() == nullptr))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Updated declaration outside global scope."));
+ solAssert(_declaration.getScope() == nullptr, "Updated declaration outside global scope.");
}
Declaration const* NameAndTypeResolver::resolveName(ASTString const& _name, Declaration const* _scope) const
@@ -133,8 +132,7 @@ void DeclarationRegistrationHelper::endVisit(VariableDefinition& _variableDefini
{
// Register the local variables with the function
// This does not fit here perfectly, but it saves us another AST visit.
- if (asserts(m_currentFunction))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Variable definition without function."));
+ solAssert(m_currentFunction, "Variable definition without function.");
m_currentFunction->addLocalVariable(_variableDefinition.getDeclaration());
}
@@ -149,15 +147,13 @@ void DeclarationRegistrationHelper::enterNewSubScope(Declaration const& _declara
map<ASTNode const*, DeclarationContainer>::iterator iter;
bool newlyAdded;
tie(iter, newlyAdded) = m_scopes.emplace(&_declaration, DeclarationContainer(m_currentScope, &m_scopes[m_currentScope]));
- if (asserts(newlyAdded))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unable to add new scope."));
+ solAssert(newlyAdded, "Unable to add new scope.");
m_currentScope = &_declaration;
}
void DeclarationRegistrationHelper::closeCurrentScope()
{
- if (asserts(m_currentScope))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Closed non-existing scope."));
+ solAssert(m_currentScope, "Closed non-existing scope.");
m_currentScope = m_scopes[m_currentScope].getEnclosingDeclaration();
}
@@ -196,8 +192,7 @@ void ReferencesResolver::endVisit(VariableDeclaration& _variable)
bool ReferencesResolver::visit(Return& _return)
{
- if (asserts(m_returnParameters))
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Return parameters not set."));
+ solAssert(m_returnParameters, "Return parameters not set.");
_return.setFunctionReturnParameters(*m_returnParameters);
return true;
}