diff options
author | Christian <c@ethdev.com> | 2015-02-10 21:57:01 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-12 18:33:09 +0800 |
commit | 79aec95228f5c766daaa9d04a3800be99ded8015 (patch) | |
tree | d1b36cff889710ea9d895722a28d6aeb67fe3761 /Types.cpp | |
parent | 20b4c6900982302fd07df12e2a1f6f0e15886834 (diff) | |
download | dexon-solidity-79aec95228f5c766daaa9d04a3800be99ded8015.tar.gz dexon-solidity-79aec95228f5c766daaa9d04a3800be99ded8015.tar.zst dexon-solidity-79aec95228f5c766daaa9d04a3800be99ded8015.zip |
Simple copy of bytes to storage.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -518,6 +518,13 @@ bool ByteArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const return (m_dynamicLength == other.m_dynamicLength || m_length == other.m_length); } +TypePointer ByteArrayType::unaryOperatorResult(Token::Value _operator) const +{ + if (_operator == Token::Delete) + return make_shared<VoidType>(); + return TypePointer(); +} + bool ByteArrayType::operator==(Type const& _other) const { if (_other.getCategory() != getCategory()) @@ -527,6 +534,14 @@ bool ByteArrayType::operator==(Type const& _other) const && other.m_length == m_length && other.m_offset == m_offset; } +unsigned ByteArrayType::getSizeOnStack() const +{ + if (m_location == Location::CallData) + return 0; + else + return 1; +} + bool ContractType::operator==(Type const& _other) const { if (_other.getCategory() != getCategory()) @@ -963,8 +978,7 @@ MagicType::MagicType(MagicType::Kind _kind): m_members = MemberList({{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, {"gas", make_shared<IntegerType>(256)}, {"value", make_shared<IntegerType>(256)}, - {"data", make_shared<ByteArrayType>(ByteArrayType::Location::CallData, - 0, 0, true)}}); + {"data", make_shared<ByteArrayType>(ByteArrayType::Location::CallData)}}); break; case Kind::Transaction: m_members = MemberList({{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, |