aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-26 01:23:39 +0800
committerChristian <c@ethdev.com>2014-11-26 22:35:25 +0800
commitf30dc68cdd3ae97305b8dfc8891da81a6d489882 (patch)
treefef4e7a9d17b682b68c20aae9fa2fe887f6ed56a /Types.cpp
parenta2715c5f34cfa4050ba64b4a1467b9ca5821472b (diff)
downloaddexon-solidity-f30dc68cdd3ae97305b8dfc8891da81a6d489882.tar.gz
dexon-solidity-f30dc68cdd3ae97305b8dfc8891da81a6d489882.tar.zst
dexon-solidity-f30dc68cdd3ae97305b8dfc8891da81a6d489882.zip
Sending ether.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Types.cpp b/Types.cpp
index a6b18b10..4ab53bf8 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -192,7 +192,7 @@ u256 IntegerType::literalValue(Literal const& _literal) const
const MemberList IntegerType::AddressMemberList =
MemberList({{"balance", make_shared<IntegerType const>(256)},
{"send", make_shared<FunctionType const>(TypePointers({make_shared<IntegerType const>(256)}),
- TypePointers())}});
+ TypePointers(), FunctionType::Location::SEND)}});
bool BoolType::isExplicitlyConvertibleTo(Type const& _convertTo) const
{
@@ -314,6 +314,7 @@ FunctionType::FunctionType(FunctionDefinition const& _function)
retParams.push_back(var->getType());
swap(params, m_parameterTypes);
swap(retParams, m_returnParameterTypes);
+ m_location = Location::INTERNAL;
}
bool FunctionType::operator==(Type const& _other) const
@@ -347,6 +348,19 @@ string FunctionType::toString() const
return name + ")";
}
+unsigned FunctionType::getSizeOnStack() const
+{
+ switch (m_location)
+ {
+ case Location::INTERNAL:
+ return 1;
+ case Location::EXTERNAL:
+ return 2;
+ default:
+ return 0;
+ }
+}
+
bool MappingType::operator==(Type const& _other) const
{
if (_other.getCategory() != getCategory())