aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-11 06:39:34 +0800
committerGitHub <noreply@github.com>2017-02-11 06:39:34 +0800
commit14ded4963d2b42443c6ddce8ad7550393ab58983 (patch)
treecb0dd96aaa2291acc4f9405bc67d1f1ba2cb3d45 /libsolidity/codegen/ExpressionCompiler.cpp
parent885b6ed96b580f9bdc214bca279e39dbaa739cf9 (diff)
parentfd7ffedead51f77135250dca29326c890f3632a2 (diff)
downloaddexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar.gz
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar.bz2
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar.lz
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar.xz
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.tar.zst
dexon-solidity-14ded4963d2b42443c6ddce8ad7550393ab58983.zip
Merge pull request #1678 from ethereum/assert
Implement assert()
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index d74d9dd3..f69d61db 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(), false);
+ m_context << Instruction::ISZERO;
+ m_context.appendConditionalJumpTo(m_context.errorTag());
+ break;
+ }
default:
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid function type."));
}