aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-23 01:38:32 +0800
committerChristian <c@ethdev.com>2015-02-23 02:16:40 +0800
commite7528c6af8a9b313b4bb20358c939f16b693e9cb (patch)
tree6564c2023a8bd2a315d69db3d55cca89c3000ae8 /Types.cpp
parentc62828c8ff8248d0b7f714d4334d5a1c41b028e2 (diff)
downloaddexon-solidity-e7528c6af8a9b313b4bb20358c939f16b693e9cb.tar.gz
dexon-solidity-e7528c6af8a9b313b4bb20358c939f16b693e9cb.tar.zst
dexon-solidity-e7528c6af8a9b313b4bb20358c939f16b693e9cb.zip
Stack height checks and fix.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Types.cpp b/Types.cpp
index 55dedd92..ce51336d 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -833,10 +833,17 @@ string FunctionType::toString() const
unsigned FunctionType::getSizeOnStack() const
{
+ Location location = m_location;
+ if (m_location == Location::SetGas || m_location == Location::SetValue)
+ {
+ solAssert(m_returnParameterTypes.size() == 1, "");
+ location = dynamic_cast<FunctionType const&>(*m_returnParameterTypes.front()).m_location;
+ }
+
unsigned size = 0;
- if (m_location == Location::External)
+ if (location == Location::External)
size = 2;
- else if (m_location == Location::Internal || m_location == Location::Bare)
+ else if (location == Location::Internal || location == Location::Bare)
size = 1;
if (m_gasSet)
size++;