summaryrefslogtreecommitdiff
path: root/src/theory/bv
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2020-06-15 11:48:02 -0700
committerGitHub <noreply@github.com>2020-06-15 11:48:02 -0700
commitaf37e2c948c140dbee2421a3cb046e068cc5b0f8 (patch)
treea40c4ec35f088ae4877df774dccaa068bd8065a2 /src/theory/bv
parent5de97c3efe8794bf7e39774686dca81a1982a8ed (diff)
BV: Add missing type check for INT_TO_BITVECTOR. (#4613)
Fixes #4130. This further makes an attempt at more consistent error printing.
Diffstat (limited to 'src/theory/bv')
-rw-r--r--src/theory/bv/theory_bv_type_rules.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/theory/bv/theory_bv_type_rules.h b/src/theory/bv/theory_bv_type_rules.h
index 97b7a8a8f..42b90cd29 100644
--- a/src/theory/bv/theory_bv_type_rules.h
+++ b/src/theory/bv/theory_bv_type_rules.h
@@ -339,6 +339,10 @@ class IntToBitVectorOpTypeRule
if (n.getKind() == kind::INT_TO_BITVECTOR_OP)
{
size_t bvSize = n.getConst<IntToBitVector>();
+ if (bvSize == 0)
+ {
+ throw TypeCheckingExceptionPrivate(n, "expecting bit-width > 0");
+ }
return nodeManager->mkFunctionType(nodeManager->integerType(),
nodeManager->mkBitVectorType(bvSize));
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback