Skip to content

Commit

Permalink
[Clang] Check that we have the correct RecordDecl (llvm#111448)
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 authored Oct 7, 2024
1 parent 991adff commit 39ac121
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 @@ -1096,7 +1096,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 39ac121

Please sign in to comment.