Skip to content

Commit

Permalink
[Clang] Check that we have the correct RecordDecl
Browse files Browse the repository at this point in the history
Ensure we have the correct RecordDecl before returning the Expr we're
looking for.
  • Loading branch information
bwendling committed Oct 7, 2024
1 parent f414a24 commit 3056b37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ class StructAccessBase
}
const Expr *VisitCastExpr(const CastExpr *E) {
if (E->getCastKind() == CK_LValueToRValue)
return E;
return IsExpectedRecordDecl(E) ? E : nullptr;
return Visit(E->getSubExpr());
}
const Expr *VisitParenExpr(const ParenExpr *E) {
Expand Down

0 comments on commit 3056b37

Please sign in to comment.