mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
[BitcodeReader] Change assert to report_fatal_error
It can be triggered by user input. Bug found with AFL fuzz. llvm-svn: 238272
This commit is contained in:
parent
41dd91ebe0
commit
829cff9ed4
@ -785,7 +785,8 @@ Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
|
||||
resize(Idx + 1);
|
||||
|
||||
if (Value *V = ValuePtrs[Idx]) {
|
||||
assert(Ty == V->getType() && "Type mismatch in constant table!");
|
||||
if (Ty != V->getType())
|
||||
report_fatal_error("Type mismatch in constant table!");
|
||||
return cast<Constant>(V);
|
||||
}
|
||||
|
||||
|
BIN
test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc
Normal file
BIN
test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc
Normal file
Binary file not shown.
@ -99,6 +99,11 @@ RUN: FileCheck --check-prefix=FWDREF-TYPE %s
|
||||
|
||||
FWDREF-TYPE: Invalid record
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch-2.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=FWDREF-TYPE-MISMATCH %s
|
||||
|
||||
FWDREF-TYPE-MISMATCH: Type mismatch in constant table!
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-element-type.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1 | \
|
||||
|
Loading…
Reference in New Issue
Block a user