diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2012-03-26 21:52:47 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-03-26 21:52:47 +0000 |
commit | 828557b1347c429e71c571d934f51d768c212999 (patch) | |
tree | 3b6cb17dd5b399cd1e31fe19ceb8934e489c596a /lib | |
parent | 0e6c50c168a757201bdac4f0d442d248bd85de9c (diff) | |
download | klee-828557b1347c429e71c571d934f51d768c212999.tar.gz |
STPBuilder: fix getShiftBits properly.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@153475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Solver/STPBuilder.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Solver/STPBuilder.h b/lib/Solver/STPBuilder.h index 7cc026bc..2b34c911 100644 --- a/lib/Solver/STPBuilder.h +++ b/lib/Solver/STPBuilder.h @@ -73,7 +73,11 @@ class STPBuilder { private: unsigned getShiftBits(unsigned amount) { - return (amount > 32) ? 6 : 5; + unsigned bits = 1; + amount--; + while (amount >>= 1) + bits++; + return bits; } ExprHandle bvOne(unsigned width); |