diff options
author | chriseth <c@ethdev.com> | 2015-03-13 20:14:51 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-14 00:31:56 +0800 |
commit | a16677dcfbd7fd7d42fbd6166e234b1b7001ec59 (patch) | |
tree | 2a885476ca571246df3615f4fcd79e3c74353879 /Compiler.cpp | |
parent | 039b133c180b15863ee3104637c97822d815d932 (diff) | |
download | dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar.gz dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar.bz2 dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar.lz dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar.xz dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.tar.zst dexon-solidity-a16677dcfbd7fd7d42fbd6166e234b1b7001ec59.zip |
Fix gas for builtin.
Fixes #1300
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index dc6e2c5a..b8ca03d3 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -228,6 +228,7 @@ void Compiler::appendCalldataUnpacker(TypePointers const& _typeParameters, bool { // Retrieve data start offset by adding length to start offset of previous dynamic type unsigned stackDepth = m_context.getStackHeight() - stackHeightOfPreviousDynamicArgument; + solAssert(stackDepth <= 16, "Stack too deep."); m_context << eth::dupInstruction(stackDepth) << eth::dupInstruction(stackDepth); ArrayUtils(m_context).convertLengthToSize(*previousDynamicType, true); m_context << eth::Instruction::ADD; @@ -359,6 +360,7 @@ bool Compiler::visit(FunctionDefinition const& _function) stackLayout.push_back(i); stackLayout += vector<int>(c_localVariablesSize, -1); + solAssert(stackLayout.size() <= 17, "Stack too deep."); while (stackLayout.back() != int(stackLayout.size() - 1)) if (stackLayout.back() < 0) { |