diff options
| -rw-r--r-- | lld/COFF/PDB.cpp | 5 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/BinaryStreamArray.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp index ccce0e711c1..9c3ff4e7f89 100644 --- a/lld/COFF/PDB.cpp +++ b/lld/COFF/PDB.cpp @@ -474,7 +474,10 @@ PDBLinker::mergeDebugT(ObjFile *File, CVIndexMap *ObjectIndexMap) { // Drop LF_PRECOMP record from the input stream, as it needs to be replaced // with the precompiled headers object type stream. - Types.drop_front(); + // Note that we can't just call Types.drop_front(), as we explicitly want to + // rebase the stream. + Types.setUnderlyingStream( + Types.getUnderlyingStream().drop_front(FirstType->RecordData.size())); } // Fill in the temporary, caller-provided ObjectIndexMap. diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h index 049cf56f4f3..7c110fcb6a4 100644 --- a/llvm/include/llvm/Support/BinaryStreamArray.h +++ b/llvm/include/llvm/Support/BinaryStreamArray.h @@ -139,7 +139,7 @@ public: this->Skew = Skew; } - void drop_front() { Stream = Stream.drop_front(begin()->length()); } + void drop_front() { Skew += begin()->length(); } private: BinaryStreamRef Stream; |

