From 95a65dc04c6f6a5c611c25d6f07d54843f2daec9 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Oct 2017 18:20:56 +0200 Subject: Fix boolean constants. --- libsolidity/formal/Z3Interface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libsolidity') diff --git a/libsolidity/formal/Z3Interface.cpp b/libsolidity/formal/Z3Interface.cpp index 0c083abc..e5c1aef4 100644 --- a/libsolidity/formal/Z3Interface.cpp +++ b/libsolidity/formal/Z3Interface.cpp @@ -139,8 +139,13 @@ z3::expr Z3Interface::toZ3Expr(Expression const& _expr) } else if (arguments.empty()) { - // We assume it is an integer... - return m_context.int_val(n.c_str()); + if (n == "true") + return m_context.bool_val(true); + else if (n == "false") + return m_context.bool_val(false); + else + // We assume it is an integer... + return m_context.int_val(n.c_str()); } solAssert(arity.count(n) && arity.at(n) == arguments.size(), ""); -- cgit v1.2.3