about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Solver/STPBuilder.h6
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);