aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-05 00:20:56 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-11-22 10:35:34 +0800
commit95a65dc04c6f6a5c611c25d6f07d54843f2daec9 (patch)
tree0bcb0ad1f7e24d8a986f40a37e0b0a2d6f4152f7 /libsolidity/formal
parent90fb14f525fa37a15421e3dc40ffc98a5bce8378 (diff)
downloaddexon-solidity-95a65dc04c6f6a5c611c25d6f07d54843f2daec9.tar.gz
dexon-solidity-95a65dc04c6f6a5c611c25d6f07d54843f2daec9.tar.zst
dexon-solidity-95a65dc04c6f6a5c611c25d6f07d54843f2daec9.zip
Fix boolean constants.
Diffstat (limited to 'libsolidity/formal')
-rw-r--r--libsolidity/formal/Z3Interface.cpp9
1 files changed, 7 insertions, 2 deletions
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(), "");