diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitstreamReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitstreamReader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp index db9e0cd63ac..43dae0c35a7 100644 --- a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp @@ -261,6 +261,10 @@ unsigned BitstreamCursor::readRecord(unsigned AbbrevID, } // Otherwise, inform the streamer that we need these bytes in memory. + // Skip over tail padding first. We can't do it later if this is a + // streaming memory object, since that could reallocate the storage that + // the blob pointer references. + JumpToBit(NewEnd); const char *Ptr = (const char*) BitStream->getBitcodeBytes().getPointer(CurBitPos/8, NumElts); @@ -272,8 +276,6 @@ unsigned BitstreamCursor::readRecord(unsigned AbbrevID, for (; NumElts; --NumElts) Vals.push_back((unsigned char)*Ptr++); } - // Skip over tail padding. - JumpToBit(NewEnd); } return Code; |