diff options
author | LianaHus <liana@ethdev.com> | 2016-01-16 00:36:06 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2016-01-16 00:36:06 +0800 |
commit | b2daa5a9d818f80df0c12e0afedb9ff549bd63d8 (patch) | |
tree | 0bbb6dd41eb7bb0716d24c728b4de617b159e36e /libsolidity | |
parent | ca45cfee8c3a1013a174b3fe499e7361c5f6d3d8 (diff) | |
download | dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar.gz dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar.bz2 dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar.lz dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar.xz dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.tar.zst dexon-solidity-b2daa5a9d818f80df0c12e0afedb9ff549bd63d8.zip |
fixed assert on EI creation for structs containing only mapping or arrays
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 14 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 4 |
2 files changed, 12 insertions, 6 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index ab1151a1..e9e76d27 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -292,17 +292,19 @@ void TypeChecker::checkContractExternalTypeClashes(ContractDefinition const& _co if (f->isPartOfExternalInterface()) { auto functionType = make_shared<FunctionType>(*f); - externalDeclarations[functionType->externalSignature()].push_back( - make_pair(f, functionType) - ); + if (functionType->interfaceFunctionType()) + externalDeclarations[functionType->externalSignature()].push_back( + make_pair(f, functionType) + ); } for (VariableDeclaration const* v: contract->stateVariables()) if (v->isPartOfExternalInterface()) { auto functionType = make_shared<FunctionType>(*v); - externalDeclarations[functionType->externalSignature()].push_back( - make_pair(v, functionType) - ); + if (functionType->interfaceFunctionType()) + externalDeclarations[functionType->externalSignature()].push_back( + make_pair(v, functionType) + ); } } for (auto const& it: externalDeclarations) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 2e9b56a1..79e5bb02 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1593,6 +1593,10 @@ FunctionTypePointer FunctionType::interfaceFunctionType() const else return FunctionTypePointer(); } + auto variable = dynamic_cast<VariableDeclaration const*>(m_declaration); + if (variable && retParamTypes.empty()) + return FunctionTypePointer(); + return make_shared<FunctionType>(paramTypes, retParamTypes, m_parameterNames, m_returnParameterNames, m_location, m_arbitraryParameters); } |