Skip to content

Commit 39ac121

Browse files
authored
[Clang] Check that we have the correct RecordDecl (#111448)
Ensure we have the correct RecordDecl before returning the Expr we're looking for.
1 parent 991adff commit 39ac121

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
@@ -1096,7 +1096,7 @@ class StructAccessBase
10961096
}
10971097
const Expr *VisitCastExpr(const CastExpr *E) {
10981098
if (E->getCastKind() == CK_LValueToRValue)
1099-
return E;
1099+
return IsExpectedRecordDecl(E) ? E : nullptr;
11001100
return Visit(E->getSubExpr());
11011101
}
11021102
const Expr *VisitParenExpr(const ParenExpr *E) {

0 commit comments

Comments
 (0)