projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b42a74f
)
[Clang] Check that we have the correct RecordDecl
author
Bill Wendling
<morbo@google.com>
Mon, 7 Oct 2024 22:25:47 +0000
(15:25 -0700)
committer
Tobias Hieta
<tobias@hieta.se>
Fri, 11 Oct 2024 06:04:20 +0000
(08:04 +0200)
Ensure we have the correct RecordDecl before returning the Expr we're
looking for.
clang/lib/CodeGen/CGExpr.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/CodeGen/CGExpr.cpp
b/clang/lib/CodeGen/CGExpr.cpp
index 8d6f535bba896ef77e97a790db7fa15500e790b1..3ef22b17f7691d054874f1b89fd42df26411df60 100644
(file)
--- a/
clang/lib/CodeGen/CGExpr.cpp
+++ b/
clang/lib/CodeGen/CGExpr.cpp
@@
-1053,7
+1053,7
@@
public:
}
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) {