diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index c36aee5b3..f2b7369b7 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -511,23 +511,20 @@ ModifierDefinition const& ModifierDefinition::resolveVirtual( ContractDefinition const* _searchStart ) const { + // Super is not possible with modifiers solAssert(_searchStart == nullptr, "Used super in connection with modifiers."); - // If we are not doing super-lookup and the modifier is not virtual, we can stop here. - if (_searchStart == nullptr && !virtualSemantics()) + // The modifier is not virtual, we can stop here. + if (!virtualSemantics()) return *this; solAssert(!dynamic_cast(*scope()).isLibrary(), ""); for (ContractDefinition const* c: _mostDerivedContract.annotation().linearizedBaseContracts) - { - if (_searchStart != nullptr && c != _searchStart) - continue; - _searchStart = nullptr; for (ModifierDefinition const* modifier: c->functionModifiers()) if (modifier->name() == name()) return *modifier; - } + solAssert(false, "Virtual modifier " + name() + " not found."); return *this; // not reached }