mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
[BitcodeReader] Make sure abbrev records have at least one operand (record code)
Bug found with AFL fuzz. llvm-svn: 238265
This commit is contained in:
parent
1db6d7f8ed
commit
f74b0c7c40
@ -282,6 +282,9 @@ void BitstreamCursor::ReadAbbrevRecord() {
|
||||
} else
|
||||
Abbv->Add(BitCodeAbbrevOp(E));
|
||||
}
|
||||
|
||||
if (Abbv->getNumOperandInfos() == 0)
|
||||
report_fatal_error("Abbrev record with no operands");
|
||||
CurAbbrevs.push_back(Abbv);
|
||||
}
|
||||
|
||||
|
BIN
test/Bitcode/Inputs/invalid-abbrev-no-operands.bc
Normal file
BIN
test/Bitcode/Inputs/invalid-abbrev-no-operands.bc
Normal file
Binary file not shown.
@ -172,3 +172,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-global-var-comdat-id.bc 2>&1
|
||||
RUN: FileCheck --check-prefix=INVALID-GVCOMDAT-ID %s
|
||||
|
||||
INVALID-GVCOMDAT-ID: Invalid global variable comdat ID
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-no-operands.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=ABBREV-NO-OPS %s
|
||||
|
||||
ABBREV-NO-OPS: Abbrev record with no operands
|
||||
|
Loading…
Reference in New Issue
Block a user