diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-09 09:37:53 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-10 21:29:17 +0800 |
commit | f8461e9e31b96e6656b8dcabd73de2e5176e6fe3 (patch) | |
tree | 585f8d6d45b6085c807d69d55a09746898f4b5de /libsolidity/codegen | |
parent | af8e31b023723bfc6baa224931ef6570cd8d9a32 (diff) | |
download | dexon-solidity-f8461e9e31b96e6656b8dcabd73de2e5176e6fe3.tar.gz dexon-solidity-f8461e9e31b96e6656b8dcabd73de2e5176e6fe3.tar.zst dexon-solidity-f8461e9e31b96e6656b8dcabd73de2e5176e6fe3.zip |
Implement assert as a global function
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index d74d9dd3..a99e3d40 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -863,6 +863,14 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) m_context << Instruction::POP; break; } + case Location::Assert: + { + arguments.front()->accept(*this); + utils().convertType(*arguments.front()->annotation().type, *function.parameterTypes().front(), true); + m_context << Instruction::ISZERO; + m_context.appendConditionalJumpTo(m_context.errorTag()); + break; + } default: BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid function type.")); } |