diff options
author | Gav Wood <g@ethdev.com> | 2015-02-18 02:38:35 +0800 |
---|---|---|
committer | Gav Wood <g@ethdev.com> | 2015-02-18 02:38:35 +0800 |
commit | 1e2d4b5c00c4875669d5daff444a5dc8ed408cb9 (patch) | |
tree | a1ebe057746c7a5e2d43ad4925fc4fa551692496 /Types.cpp | |
parent | 41e609629549070dbab7892fbde7f9fd49695630 (diff) | |
parent | a33fa270f689168f84c0db6aa673658ae92fb495 (diff) | |
download | dexon-solidity-1e2d4b5c00c4875669d5daff444a5dc8ed408cb9.tar.gz dexon-solidity-1e2d4b5c00c4875669d5daff444a5dc8ed408cb9.tar.zst dexon-solidity-1e2d4b5c00c4875669d5daff444a5dc8ed408cb9.zip |
Merge pull request #1072 from chriseth/sol_external
bytes ABI type and external visibility specifier
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -540,12 +540,19 @@ bool ByteArrayType::operator==(Type const& _other) const unsigned ByteArrayType::getSizeOnStack() const { if (m_location == Location::CallData) - return 0; + // offset, length (stack top) + return 2; else + // offset return 1; } -const MemberList ByteArrayType::s_byteArrayMemberList = MemberList({{"length", make_shared<IntegerType >(256)}}); +shared_ptr<ByteArrayType> ByteArrayType::copyForLocation(ByteArrayType::Location _location) const +{ + return make_shared<ByteArrayType>(_location); +} + +const MemberList ByteArrayType::s_byteArrayMemberList = MemberList({{"length", make_shared<IntegerType>(256)}}); bool ContractType::operator==(Type const& _other) const { @@ -572,7 +579,8 @@ MemberList const& ContractType::getMembers() const { for (ContractDefinition const* base: m_contract.getLinearizedBaseContracts()) for (ASTPointer<FunctionDefinition> const& function: base->getDefinedFunctions()) - if (!function->isConstructor() && !function->getName().empty()) + if (!function->isConstructor() && !function->getName().empty() && + function->isVisibleInDerivedContracts()) members.insert(make_pair(function->getName(), make_shared<FunctionType>(*function, true))); } else @@ -957,10 +965,10 @@ MemberList const& TypeType::getMembers() const ContractDefinition const& contract = dynamic_cast<ContractType const&>(*m_actualType).getContractDefinition(); vector<ContractDefinition const*> currentBases = m_currentContract->getLinearizedBaseContracts(); if (find(currentBases.begin(), currentBases.end(), &contract) != currentBases.end()) - // We are accessing the type of a base contract, so add all public and private + // We are accessing the type of a base contract, so add all public and protected // functions. Note that this does not add inherited functions on purpose. for (ASTPointer<FunctionDefinition> const& f: contract.getDefinedFunctions()) - if (!f->isConstructor() && !f->getName().empty()) + if (!f->isConstructor() && !f->getName().empty() && f->isVisibleInDerivedContracts()) members[f->getName()] = make_shared<FunctionType>(*f); } else if (m_actualType->getCategory() == Category::Enum) |