mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[BitCode] Make sure storeatomic's argument is an actual PointerType
llvm-svn: 271850
This commit is contained in:
parent
06c97ab46d
commit
020e10c851
@ -5259,6 +5259,7 @@ std::error_code BitcodeReader::parseFunctionBody(Function *F) {
|
||||
unsigned OpNum = 0;
|
||||
Value *Val, *Ptr;
|
||||
if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
|
||||
!isa<PointerType>(Ptr->getType()) ||
|
||||
(BitCode == bitc::FUNC_CODE_INST_STOREATOMIC
|
||||
? getValueTypePair(Record, OpNum, NextValueNo, Val)
|
||||
: popValue(Record, OpNum, NextValueNo,
|
||||
|
BIN
test/Bitcode/Inputs/invalid-nonpointer-storeatomic.bc
Normal file
BIN
test/Bitcode/Inputs/invalid-nonpointer-storeatomic.bc
Normal file
Binary file not shown.
@ -222,3 +222,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-no-operands.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=GEP-NO-OPERANDS %s
|
||||
|
||||
GEP-NO-OPERANDS: Invalid gep with no operands
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-storeatomic.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=NONPOINTER-STOREATOMIC %s
|
||||
|
||||
NONPOINTER-STOREATOMIC: Invalid record
|
||||
|
Loading…
Reference in New Issue
Block a user