diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2020-06-15 11:48:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 11:48:02 -0700 |
commit | af37e2c948c140dbee2421a3cb046e068cc5b0f8 (patch) | |
tree | a40c4ec35f088ae4877df774dccaa068bd8065a2 /src/theory | |
parent | 5de97c3efe8794bf7e39774686dca81a1982a8ed (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')
-rw-r--r-- | src/theory/bv/theory_bv_type_rules.h | 4 |
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)); } |