aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-16 00:02:09 +0800
committerchriseth <c@ethdev.com>2015-05-16 00:02:09 +0800
commitdba5ffc280c363b445fb8fcc22737605f2c61498 (patch)
tree57d5ffc9310b8245973b2ea0649ea5930fdcc7c6 /Types.cpp
parent33e708605881614acefaae2c324732299d7f61fb (diff)
downloaddexon-solidity-dba5ffc280c363b445fb8fcc22737605f2c61498.tar.gz
dexon-solidity-dba5ffc280c363b445fb8fcc22737605f2c61498.tar.zst
dexon-solidity-dba5ffc280c363b445fb8fcc22737605f2c61498.zip
Bare callcode for addresses and contracts.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/Types.cpp b/Types.cpp
index 7a5b309d..d1f51dec 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -316,6 +316,7 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
const MemberList IntegerType::AddressMemberList({
{"balance", make_shared<IntegerType >(256)},
{"call", make_shared<FunctionType>(strings(), strings(), FunctionType::Location::Bare, true)},
+ {"callcode", make_shared<FunctionType>(strings(), strings(), FunctionType::Location::BareCallCode, true)},
{"send", make_shared<FunctionType>(strings{"uint"}, strings{}, FunctionType::Location::Send)}
});
@@ -1115,9 +1116,11 @@ unsigned FunctionType::getSizeOnStack() const
}
unsigned size = 0;
- if (location == Location::External)
+ if (location == Location::External || location == Location::CallCode)
size = 2;
- else if (location == Location::Internal || location == Location::Bare)
+ else if (location == Location::Bare || location == Location::BareCallCode)
+ size = 1;
+ else if (location == Location::Internal)
size = 1;
if (m_gasSet)
size++;
@@ -1156,6 +1159,7 @@ MemberList const& FunctionType::getMembers() const
case Location::SHA256:
case Location::RIPEMD160:
case Location::Bare:
+ case Location::BareCallCode:
if (!m_members)
{
MemberList::MemberMap members{
@@ -1228,6 +1232,21 @@ bool FunctionType::hasEqualArgumentTypes(FunctionType const& _other) const
);
}
+bool FunctionType::isBareCall() const
+{
+ switch (m_location)
+ {
+ case Location::Bare:
+ case Location::BareCallCode:
+ case Location::ECRecover:
+ case Location::SHA256:
+ case Location::RIPEMD160:
+ return true;
+ default:
+ return false;
+ }
+}
+
string FunctionType::externalSignature(std::string const& _name) const
{
std::string funcName = _name;