diff options
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp index 403c02b4268..e52c88a5bfb 100644 --- a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp +++ b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp @@ -63,6 +63,7 @@ std::unique_ptr<MappedBlockStream> MappedBlockStream::createIndexedStream(const MSFLayout &Layout, const ReadableStream &MsfData, uint32_t StreamIndex) { + assert(StreamIndex < Layout.StreamMap.size() && "Invalid stream index"); MSFStreamLayout SL; SL.Blocks = Layout.StreamMap[StreamIndex]; SL.Length = Layout.StreamSizes[StreamIndex]; @@ -334,6 +335,7 @@ std::unique_ptr<WritableMappedBlockStream> WritableMappedBlockStream::createIndexedStream(const MSFLayout &Layout, const WritableStream &MsfData, uint32_t StreamIndex) { + assert(StreamIndex < Layout.StreamMap.size() && "Invalid stream index"); MSFStreamLayout SL; SL.Blocks = Layout.StreamMap[StreamIndex]; SL.Length = Layout.StreamSizes[StreamIndex]; |