summaryrefslogtreecommitdiff
path: root/src/smt/smt_engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/smt/smt_engine.cpp')
-rw-r--r--src/smt/smt_engine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index 62afbf987..e4b9023d5 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -2603,8 +2603,9 @@ Node SmtEnginePrivate::intToBV(TNode n, NodeMap& cache) {
case kind::CONST_RATIONAL: {
Rational constant = current.getConst<Rational>();
AlwaysAssert(constant.isIntegral());
+ AlwaysAssert(constant >= 0);
BitVector bv(size, constant.getNumerator());
- if (bv.getValue() != constant.getNumerator()) {
+ if (bv.toSignedInt() != constant.getNumerator()) {
throw TypeCheckingException(current.toExpr(), string("Not enough bits for constant in intToBV: ") + current.toString());
}
result = nm->mkConst(bv);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback