Skip to content

Commit 103f1be

Browse files
committed
[clang][Interp][NFC] getRecord() might return null
1 parent 8e45935 commit 103f1be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,8 @@ bool ByteCodeExprGen<Emitter>::VisitMemberExpr(const MemberExpr *E) {
13511351
if (const auto *FD = dyn_cast<FieldDecl>(Member)) {
13521352
const RecordDecl *RD = FD->getParent();
13531353
const Record *R = getRecord(RD);
1354+
if (!R)
1355+
return false;
13541356
const Record::Field *F = R->getField(FD);
13551357
// Leave a pointer to the field on the stack.
13561358
if (F->Decl->getType()->isReferenceType())

0 commit comments

Comments
 (0)