From 2a560b798b5f5ece6dfb500a8e03409c62332e41 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 11 Jul 2016 15:04:33 +0200 Subject: Throw if contract creation fails. --- libsolidity/codegen/ExpressionCompiler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity') 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; -- cgit v1.2.3