diff options
author | chriseth <c@ethdev.com> | 2016-07-11 21:04:33 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-08-16 20:49:44 +0800 |
commit | 2a560b798b5f5ece6dfb500a8e03409c62332e41 (patch) | |
tree | a0d30e1941d498f59ba88563ca625fc83da6771d /libsolidity/codegen | |
parent | e3e4d84f3353eaaaadae7c1c6eac9e890188d0f8 (diff) | |
download | dexon-solidity-2a560b798b5f5ece6dfb500a8e03409c62332e41.tar.gz dexon-solidity-2a560b798b5f5ece6dfb500a8e03409c62332e41.tar.zst dexon-solidity-2a560b798b5f5ece6dfb500a8e03409c62332e41.zip |
Throw if contract creation fails.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 1d574556..3fbf27ce 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -533,6 +533,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) else m_context << u256(0); m_context << Instruction::CREATE; + // Check if zero (out of stack or not enough balance). + m_context << Instruction::DUP1 << Instruction::ISZERO; + m_context.appendConditionalJumpTo(m_context.errorTag()); if (function.valueSet()) m_context << swapInstruction(1) << Instruction::POP; break; |