diff options
author | Christian <c@ethdev.com> | 2015-02-23 01:38:32 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-23 02:16:40 +0800 |
commit | e7528c6af8a9b313b4bb20358c939f16b693e9cb (patch) | |
tree | 6564c2023a8bd2a315d69db3d55cca89c3000ae8 /Types.cpp | |
parent | c62828c8ff8248d0b7f714d4334d5a1c41b028e2 (diff) | |
download | dexon-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.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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++; |