From 7b56206a9809c12d9c6e94a0f1dd43f40506c9b5 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 16 Oct 2015 14:52:01 +0200 Subject: Do not catch InternalCompilerErrors as part of fatal error handling. InternalCompilerErrors always have to end the whole compilation process because a serious inconsistency was detected. --- libsolidity/NameAndTypeResolver.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libsolidity/NameAndTypeResolver.cpp') diff --git a/libsolidity/NameAndTypeResolver.cpp b/libsolidity/NameAndTypeResolver.cpp index abf0788a..edd0704d 100644 --- a/libsolidity/NameAndTypeResolver.cpp +++ b/libsolidity/NameAndTypeResolver.cpp @@ -49,8 +49,10 @@ bool NameAndTypeResolver::registerDeclarations(SourceUnit& _sourceUnit) { DeclarationRegistrationHelper registrar(m_scopes, _sourceUnit, m_errors); } - catch (FatalError) + catch (FatalError const& _e) { + if (m_errors.empty()) + throw; // Something is weird here, rather throw again. return false; } return true; @@ -124,6 +126,8 @@ bool NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract) } catch (FatalError const& _e) { + if (m_errors.empty()) + throw; // Something is weird here, rather throw again. return false; } return true; @@ -136,8 +140,10 @@ bool NameAndTypeResolver::updateDeclaration(Declaration const& _declaration) m_scopes[nullptr].registerDeclaration(_declaration, false, true); solAssert(_declaration.scope() == nullptr, "Updated declaration outside global scope."); } - catch(FatalError const& _error) + catch (FatalError const& _error) { + if (m_errors.empty()) + throw; // Something is weird here, rather throw again. return false; } return true; -- cgit