mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Stack height checks and fix.
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user