summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-12-14 18:46:43 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-12-14 18:46:43 +0000
commita1cedd6c46705aac4d78e827c6ca6a365fbafa32 (patch)
treebeec847e4f92a549d851c98cf2f2b3bcc7c3cb22 /llvm/lib
parent5b0d5b45a241a9563d1075fa8e66be941b96443b (diff)
downloadbcm5719-llvm-a1cedd6c46705aac4d78e827c6ca6a365fbafa32.tar.gz
bcm5719-llvm-a1cedd6c46705aac4d78e827c6ca6a365fbafa32.zip
[MC] Allow .file directives to be out-of-order
llvm-svn: 320727
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp3
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];
OpenPOWER on IntegriCloud