diff options
| author | Mingming Liu <mingmingl@google.com> | 2025-09-10 15:25:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 15:25:31 -0700 |
| commit | 1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch) | |
| tree | 57f4b1f313c8cf74eed8819870f39c36ea263c68 /clang/lib/StaticAnalyzer/Checkers/WebKit | |
| parent | 898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff) | |
| parent | b8cefcb601ddaa18482555c4ff363c01a270c2fe (diff) | |
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/WebKit')
3 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp index 478bd8517714..0d2294e1e9bb 100644 --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp @@ -208,6 +208,8 @@ bool isASafeCallArg(const Expr *E) { return true; } } + if (isa<CXXTemporaryObjectExpr>(E)) + return true; // A temporary lives until the end of this statement. if (isConstOwnerPtrMemberExpr(E)) return true; diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp index 36c12582a578..884dbe90e7b1 100644 --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp @@ -241,7 +241,7 @@ void RetainTypeChecker::visitTypedef(const TypedefDecl *TD) { return; auto PointeeQT = QT->getPointeeType(); - const RecordType *RT = PointeeQT->getAs<RecordType>(); + const RecordType *RT = PointeeQT->getAsCanonical<RecordType>(); if (!RT) { if (TD->hasAttr<ObjCBridgeAttr>() || TD->hasAttr<ObjCBridgeMutableAttr>()) { RecordlessTypes.insert(TD->getASTContext() diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp index 27a91132fa9b..03eeb9999c4d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp @@ -232,14 +232,11 @@ public: if (!Init) return nullptr; if (auto *Lambda = dyn_cast<LambdaExpr>(Init)) { + DeclRefExprsToIgnore.insert(DRE); updateIgnoreList(); return Lambda; } - TempExpr = dyn_cast<CXXBindTemporaryExpr>(Init->IgnoreParenCasts()); - if (!TempExpr) - return nullptr; - updateIgnoreList(); - return dyn_cast_or_null<LambdaExpr>(TempExpr->getSubExpr()); + return nullptr; } void checkCalleeLambda(CallExpr *CE) { |
