Skip to content

Commit 6c1fd53

Browse files
bwendlingtru
authored andcommitted
[Clang] Check that we have the correct RecordDecl
Ensure we have the correct RecordDecl before returning the Expr we're looking for.
1 parent b42a74f commit 6c1fd53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ class StructAccessBase
10531053
}
10541054
const Expr *VisitCastExpr(const CastExpr *E) {
10551055
if (E->getCastKind() == CK_LValueToRValue)
1056-
return E;
1056+
return IsExpectedRecordDecl(E) ? E : nullptr;
10571057
return Visit(E->getSubExpr());
10581058
}
10591059
const Expr *VisitParenExpr(const ParenExpr *E) {

0 commit comments

Comments
 (0)