aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-22 21:44:33 +0800
committerGitHub <noreply@github.com>2018-02-22 21:44:33 +0800
commit090d7037409247bd16fc0f9ae41500fa42dde498 (patch)
tree0aeeceaff61da4808916323aeba4169a7ba78be4
parentca35963f84c73e6faec990ffe9d3f7a8d8a387c5 (diff)
parent68a8e67cc37bf6f923f3b51781f2613168fa4d38 (diff)
downloaddexon-solidity-090d7037409247bd16fc0f9ae41500fa42dde498.tar.gz
dexon-solidity-090d7037409247bd16fc0f9ae41500fa42dde498.tar.zst
dexon-solidity-090d7037409247bd16fc0f9ae41500fa42dde498.zip
Merge pull request #3571 from ethereum/cppcheck
Mark functions const
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.cpp6
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp
index 0c7365fb..2a97429b 100644
--- a/libjulia/backends/evm/EVMCodeTransform.cpp
+++ b/libjulia/backends/evm/EVMCodeTransform.cpp
@@ -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), "");
int heightDiff = m_assembly.stackHeight() - m_context->variableStackHeights[&_var];
@@ -537,12 +537,12 @@ int CodeTransform::variableHeightDiff(solidity::assembly::Scope::Variable const&
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.");
}
-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(
diff --git a/libjulia/backends/evm/EVMCodeTransform.h b/libjulia/backends/evm/EVMCodeTransform.h
index 0f2aaf95..f8eec0b7 100644
--- a/libjulia/backends/evm/EVMCodeTransform.h
+++ b/libjulia/backends/evm/EVMCodeTransform.h
@@ -133,11 +133,11 @@ private:
/// 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
/// 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;
solidity::assembly::AsmAnalysisInfo& m_info;