Fix Bug: Assembler/2003-05-12-MinIntProblem.llx
authorChris Lattner <sabre@nondot.org>
Mon, 12 May 2003 15:13:52 +0000 (15:13 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 12 May 2003 15:13:52 +0000 (15:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6123 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/ConstantReader.cpp

index d1c8644ddd4fe8c5ef035eee8004014620f3b351..0ad38b4025fe61930a5b87feff4bef0d13d3ed77 100644 (file)
@@ -245,19 +245,13 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf,
     break;
   }
 
-  case Type::SByteTyID:   // Unsigned integer types...
+  case Type::SByteTyID:   // Signed integer types...
   case Type::ShortTyID:
   case Type::IntTyID: {
-    int Val;
-    if (read_vbr(Buf, EndBuf, Val)) return true;
-    if (!ConstantSInt::isValueValidForType(Ty, Val)) return true;
-    V = ConstantSInt::get(Ty, Val);
-    break;
-  }
-
-  case Type::LongTyID: {
+  case Type::LongTyID:
     int64_t Val;
     if (read_vbr(Buf, EndBuf, Val)) return true;
+    if (!ConstantSInt::isValueValidForType(Ty, Val)) return true;
     V = ConstantSInt::get(Ty, Val);
     break;
   }