mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
commit
090d703740
@ -522,7 +522,7 @@ void CodeTransform::generateAssignment(Identifier const& _variableName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CodeTransform::variableHeightDiff(solidity::assembly::Scope::Variable const& _var, bool _forSwap)
|
int CodeTransform::variableHeightDiff(solidity::assembly::Scope::Variable const& _var, bool _forSwap) const
|
||||||
{
|
{
|
||||||
solAssert(m_context->variableStackHeights.count(&_var), "");
|
solAssert(m_context->variableStackHeights.count(&_var), "");
|
||||||
int heightDiff = m_assembly.stackHeight() - m_context->variableStackHeights[&_var];
|
int heightDiff = m_assembly.stackHeight() - m_context->variableStackHeights[&_var];
|
||||||
@ -537,12 +537,12 @@ int CodeTransform::variableHeightDiff(solidity::assembly::Scope::Variable const&
|
|||||||
return heightDiff;
|
return heightDiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeTransform::expectDeposit(int _deposit, int _oldHeight)
|
void CodeTransform::expectDeposit(int _deposit, int _oldHeight) const
|
||||||
{
|
{
|
||||||
solAssert(m_assembly.stackHeight() == _oldHeight + _deposit, "Invalid stack deposit.");
|
solAssert(m_assembly.stackHeight() == _oldHeight + _deposit, "Invalid stack deposit.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeTransform::checkStackHeight(void const* _astElement)
|
void CodeTransform::checkStackHeight(void const* _astElement) const
|
||||||
{
|
{
|
||||||
solAssert(m_info.stackHeightInfo.count(_astElement), "Stack height for AST element not found.");
|
solAssert(m_info.stackHeightInfo.count(_astElement), "Stack height for AST element not found.");
|
||||||
solAssert(
|
solAssert(
|
||||||
|
@ -133,11 +133,11 @@ private:
|
|||||||
/// Determines the stack height difference to the given variables. Throws
|
/// Determines the stack height difference to the given variables. Throws
|
||||||
/// if it is not yet in scope or the height difference is too large. Returns
|
/// if it is not yet in scope or the height difference is too large. Returns
|
||||||
/// the (positive) stack height difference otherwise.
|
/// the (positive) stack height difference otherwise.
|
||||||
int variableHeightDiff(solidity::assembly::Scope::Variable const& _var, bool _forSwap);
|
int variableHeightDiff(solidity::assembly::Scope::Variable const& _var, bool _forSwap) const;
|
||||||
|
|
||||||
void expectDeposit(int _deposit, int _oldHeight);
|
void expectDeposit(int _deposit, int _oldHeight) const;
|
||||||
|
|
||||||
void checkStackHeight(void const* _astElement);
|
void checkStackHeight(void const* _astElement) const;
|
||||||
|
|
||||||
julia::AbstractAssembly& m_assembly;
|
julia::AbstractAssembly& m_assembly;
|
||||||
solidity::assembly::AsmAnalysisInfo& m_info;
|
solidity::assembly::AsmAnalysisInfo& m_info;
|
||||||
|
Loading…
Reference in New Issue
Block a user