aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-08-16 22:13:56 +0800
committerGitHub <noreply@github.com>2016-08-16 22:13:56 +0800
commit480cf384bbe923bdb3c5e1a16fb4670a2db6c03c (patch)
tree314a8489030bdd9c2c8f0f6496a259eaaa6259e2 /libsolidity
parent70994f49960dd7066ad5de6fe835ccb1201269a6 (diff)
parent2a560b798b5f5ece6dfb500a8e03409c62332e41 (diff)
downloaddexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar.gz
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar.bz2
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar.lz
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar.xz
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.tar.zst
dexon-solidity-480cf384bbe923bdb3c5e1a16fb4670a2db6c03c.zip
Merge pull request #710 from chriseth/throwFailedCreate
BREAKING: Throw if contract creation fails.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp3
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;