aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
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())