diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-04-11 16:31:03 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-04-11 16:31:03 +0000 |
commit | d01d291be3213368985f28d0072905c4f033d5ff (patch) | |
tree | 8524a2b6a00c012221ecca9266c3ab9fb11989ed /src/util | |
parent | 889853e225687dfef36b15ca1dccf74682e0fd66 (diff) |
merge from arrays-clark branch
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/bitvector.h | 8 | ||||
-rw-r--r-- | src/util/ntuple.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/util/bitvector.h b/src/util/bitvector.h index 512f23136..5d0c301d4 100644 --- a/src/util/bitvector.h +++ b/src/util/bitvector.h @@ -188,12 +188,20 @@ public: BitVector unsignedDiv (const BitVector& y) const { Assert (d_size == y.d_size); + // TODO: decide whether we really want these semantics + if (y.d_value == 0) { + return BitVector(d_size, Integer(0)); + } Assert (d_value >= 0 && y.d_value > 0); return BitVector(d_size, d_value.floorDivideQuotient(y.d_value)); } BitVector unsignedRem(const BitVector& y) const { Assert (d_size == y.d_size); + // TODO: decide whether we really want these semantics + if (y.d_value == 0) { + return BitVector(d_size, Integer(0)); + } Assert (d_value >= 0 && y.d_value > 0); return BitVector(d_size, d_value.floorDivideRemainder(y.d_value)); } diff --git a/src/util/ntuple.h b/src/util/ntuple.h index 4f8b73945..a3d28977f 100644 --- a/src/util/ntuple.h +++ b/src/util/ntuple.h @@ -30,6 +30,7 @@ public: T1 first; T2 second; T3 third; + triple() {} triple(const T1& t1, const T2& t2, const T3& t3) : first(t1), second(t2), @@ -50,6 +51,7 @@ public: T2 second; T3 third; T4 fourth; + quad() {} quad(const T1& t1, const T2& t2, const T3& t3, const T4& t4) : first(t1), second(t2), |