[Bitcode] Fix size check for DIImportedEntity record
This was using && instead of ||.
This commit is contained in:
parent
72248712e5
commit
ea93ca60ef
|
@ -2033,8 +2033,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
|
|||
break;
|
||||
}
|
||||
case bitc::METADATA_IMPORTED_ENTITY: {
|
||||
if (Record.size() < 6 && Record.size() > 8)
|
||||
return error("Invalid record");
|
||||
if (Record.size() < 6 || Record.size() > 8)
|
||||
return error("Invalid DIImportedEntity record");
|
||||
|
||||
IsDistinct = Record[0];
|
||||
bool HasFile = (Record.size() >= 7);
|
||||
|
|
Binary file not shown.
|
@ -286,3 +286,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-chunk-size.bc 2>&1 | \
|
|||
RUN: FileCheck --check-prefix=INVALID-CHUNK-SIZE %s
|
||||
|
||||
INVALID-CHUNK-SIZE: Fixed or VBR abbrev record with size > MaxChunkData
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-diimportedentity-record.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=INVALID-DIIMPORTEDENTITY-RECORD %s
|
||||
|
||||
INVALID-DIIMPORTEDENTITY-RECORD: Invalid DIImportedEntity record
|
||||
|
|
Loading…
Reference in New Issue