From 54e3637d234653e0f0e282220e3a628766a86adb Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 18 Dec 2015 15:56:26 +0100 Subject: Add structs and enums to contract types. --- libsolidity/codegen/ExpressionCompiler.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libsolidity/codegen') diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index dcdab2a7..2fd0b2c4 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -913,14 +913,16 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) if (dynamic_cast(type.actualType().get())) { - auto const& funType = dynamic_cast(*_memberAccess.annotation().type); - if (funType.location() != FunctionType::Location::Internal) - m_context << funType.externalIdentifier(); - else + if (auto funType = dynamic_cast(_memberAccess.annotation().type.get())) { - auto const* function = dynamic_cast(_memberAccess.annotation().referencedDeclaration); - solAssert(!!function, "Function not found in member access"); - m_context << m_context.functionEntryLabel(*function).pushTag(); + if (funType->location() != FunctionType::Location::Internal) + m_context << funType->externalIdentifier(); + else + { + auto const* function = dynamic_cast(_memberAccess.annotation().referencedDeclaration); + solAssert(!!function, "Function not found in member access"); + m_context << m_context.functionEntryLabel(*function).pushTag(); + } } } else if (auto enumType = dynamic_cast(type.actualType().get())) -- cgit