Support for expanding the result of EXTRACT_ELEMENT.
[oota-llvm.git] / lib / Bitcode / Reader / Deserialize.cpp
index 8e0b62c509506a4de02654804c8eed5f74a33741..2014557a1012da2755b6e2f0fda94a27dc3e4939 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Ted Kremenek and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -85,7 +85,7 @@ bool Deserializer::AdvanceStream() {
         
       case bitc::END_BLOCK: {
         bool x = Stream.ReadBlockEnd();
-        assert (!x && "Error at block end.");
+        assert(!x && "Error at block end."); x=x;
         BlockStack.pop_back();
         continue;
       }
@@ -115,7 +115,7 @@ void Deserializer::ReadRecord() {
   if (Stream.AtEndOfStream())
     return;
   
-  assert (Record.size() == 0);
+  assert (Record.empty());
   assert (AbbrevNo >= bitc::UNABBREV_RECORD);
   RecordCode = Stream.ReadRecord(AbbrevNo,Record);
   assert (Record.size() > 0);
@@ -324,7 +324,7 @@ char* Deserializer::ReadCStr(char* cstr, unsigned MaxLen, bool isNullTerm) {
     cstr[i] = (char) ReadInt();
   
   if (isNullTerm)
-    cstr[len+1] = '\0';
+    cstr[len] = '\0';
   
   return cstr;
 }