aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ContractCompiler.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-08-17 22:24:22 +0800
committerGitHub <noreply@github.com>2016-08-17 22:24:22 +0800
commit6baa982a6a95189af8199e719e62314b1073aa62 (patch)
treef3035811927d84edf869a3e1eb5358adb2aa96be /libsolidity/codegen/ContractCompiler.h
parent9f22426d1099151efe657caab91306d5ade727a6 (diff)
parent9c83109549547c8fe308969f924d3c07ce2cac76 (diff)
downloaddexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar.gz
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar.bz2
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar.lz
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar.xz
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.tar.zst
dexon-solidity-6baa982a6a95189af8199e719e62314b1073aa62.zip
Merge pull request #835 from chriseth/modifierreturn
BREAKING: return only exits current function/modifier
Diffstat (limited to 'libsolidity/codegen/ContractCompiler.h')
-rw-r--r--libsolidity/codegen/ContractCompiler.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/libsolidity/codegen/ContractCompiler.h b/libsolidity/codegen/ContractCompiler.h
index d1517e88..0799a543 100644
--- a/libsolidity/codegen/ContractCompiler.h
+++ b/libsolidity/codegen/ContractCompiler.h
@@ -40,11 +40,9 @@ class ContractCompiler: private ASTConstVisitor
public:
explicit ContractCompiler(CompilerContext& _context, bool _optimise):
m_optimise(_optimise),
- m_context(_context),
- m_returnTag(eth::Tag, u256(-1))
+ m_context(_context)
{
m_context = CompilerContext();
- m_returnTag = m_context.newTag();
}
void compileContract(
@@ -122,7 +120,8 @@ private:
CompilerContext& m_context;
std::vector<eth::AssemblyItem> m_breakTags; ///< tag to jump to for a "break" statement
std::vector<eth::AssemblyItem> m_continueTags; ///< tag to jump to for a "continue" statement
- eth::AssemblyItem m_returnTag; ///< tag to jump to for a "return" statement
+ /// Tag to jump to for a "return" statement, needs to be stacked because of modifiers.
+ std::vector<eth::AssemblyItem> m_returnTags;
unsigned m_modifierDepth = 0;
FunctionDefinition const* m_currentFunction = nullptr;
unsigned m_stackCleanupForReturn = 0; ///< this number of stack elements need to be removed before jump to m_returnTag