Stack height checks and fix.

This commit is contained in:
Christian
2015-02-22 19:16:40 +01:00
parent c62828c8ff
commit e7528c6af8
4 changed files with 47 additions and 8 deletions
+9 -2
View File
@@ -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++;