diff options
Diffstat (limited to 'llvm/lib/MC')
| -rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index bda0ec14599..9e5d9ff73c7 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -435,7 +435,8 @@ unsigned MCDwarfLineTableHeader::getFile(StringRef &Directory, return IterBool.first->second; } // Make space for this FileNumber in the MCDwarfFiles vector if needed. - MCDwarfFiles.resize(FileNumber + 1); + if (FileNumber >= MCDwarfFiles.size()) + MCDwarfFiles.resize(FileNumber + 1); // Get the new MCDwarfFile slot for this FileNumber. MCDwarfFile &File = MCDwarfFiles[FileNumber]; |

