Fix a bug in an assert that would never trigger.
authorReid Spencer <rspencer@reidspencer.com>
Mon, 8 Jan 2007 05:34:39 +0000 (05:34 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 8 Jan 2007 05:34:39 +0000 (05:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33005 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ConstantRange.cpp
lib/Support/ConstantRange.cpp

index 33a67022593ce9993d3195fa90c55c3a3e4bd3a2..a8ffa5813e728352826ddf7542d133173752ce01 100644 (file)
@@ -355,7 +355,7 @@ ConstantRange ConstantRange::zeroExtend(const Type *Ty) const {
 /// truncated to the specified type.
 ConstantRange ConstantRange::truncate(const Type *Ty) const {
   unsigned SrcTySize = getLower()->getType()->getPrimitiveSizeInBits();
-  assert(SrcTySize > Ty->getPrimitiveSize() && "Not a value truncation");
+  assert(SrcTySize > Ty->getPrimitiveSizeInBits() && "Not a value truncation");
   uint64_t Size = 1ULL << Ty->getPrimitiveSizeInBits();
   if (isFullSet() || getSetSize() >= Size)
     return ConstantRange(getType());
index 33a67022593ce9993d3195fa90c55c3a3e4bd3a2..a8ffa5813e728352826ddf7542d133173752ce01 100644 (file)
@@ -355,7 +355,7 @@ ConstantRange ConstantRange::zeroExtend(const Type *Ty) const {
 /// truncated to the specified type.
 ConstantRange ConstantRange::truncate(const Type *Ty) const {
   unsigned SrcTySize = getLower()->getType()->getPrimitiveSizeInBits();
-  assert(SrcTySize > Ty->getPrimitiveSize() && "Not a value truncation");
+  assert(SrcTySize > Ty->getPrimitiveSizeInBits() && "Not a value truncation");
   uint64_t Size = 1ULL << Ty->getPrimitiveSizeInBits();
   if (isFullSet() || getSetSize() >= Size)
     return ConstantRange(getType());