summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-29 05:25:17 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-29 05:25:17 +0000
commitbb7ce3b8500ee0c40bd3619058f3d1f980a8b291 (patch)
tree91ab3ad3b545bbc21cf47feeb71ddb864450d143 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent3acdfeee1115ff2bf55ad44cae39d6360b5500df (diff)
downloadbcm5719-llvm-bb7ce3b8500ee0c40bd3619058f3d1f980a8b291.tar.gz
bcm5719-llvm-bb7ce3b8500ee0c40bd3619058f3d1f980a8b291.zip
BitcodeReader: Allow METADATA_STRINGS to only have !""
Support parsing a METADATA_STRINGS record that only has a single piece of metadata, !"". Fixes a corner case in r264551. llvm-svn: 264699
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index cb2784ff204..72ac217bef2 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1899,7 +1899,7 @@ std::error_code BitcodeReader::parseMetadataStrings(ArrayRef<uint64_t> Record,
unsigned StringsOffset = Record[1];
if (!NumStrings)
return error("Invalid record: metadata strings with no strings");
- if (StringsOffset >= Blob.size())
+ if (StringsOffset > Blob.size())
return error("Invalid record: metadata strings corrupt offset");
StringRef Lengths = Blob.slice(0, StringsOffset);
OpenPOWER on IntegriCloud