mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
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
This commit is contained in:
parent
d2d01d1984
commit
4c3b875a0b
@ -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);
|
||||
|
7
test/Bitcode/metadata-only-empty-string.ll
Normal file
7
test/Bitcode/metadata-only-empty-string.ll
Normal file
@ -0,0 +1,7 @@
|
||||
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
|
||||
|
||||
; CHECK: !named = !{!0}
|
||||
!named = !{!0}
|
||||
|
||||
; CHECK: !0 = !{!""}
|
||||
!0 = !{!""}
|
Loading…
x
Reference in New Issue
Block a user