Skip to content

Commit ed07fc8

Browse files
committed
[Bitcode] Add missing getValue() return value checks
1 parent 4648acb commit ed07fc8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5363,6 +5363,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
53635363
Type *TokenTy = Type::getTokenTy(Context);
53645364
Value *ParentPad = getValue(Record, Idx++, NextValueNo, TokenTy,
53655365
getVirtualTypeID(TokenTy), CurBB);
5366+
if (!ParentPad)
5367+
return error("Invalid record");
53665368

53675369
unsigned NumHandlers = Record[Idx++];
53685370

@@ -5404,6 +5406,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
54045406
Type *TokenTy = Type::getTokenTy(Context);
54055407
Value *ParentPad = getValue(Record, Idx++, NextValueNo, TokenTy,
54065408
getVirtualTypeID(TokenTy), CurBB);
5409+
if (!ParentPad)
5410+
return error("Invald record");
54075411

54085412
unsigned NumArgOperands = Record[Idx++];
54095413

0 commit comments

Comments
 (0)