Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the assertion failure in Analysis/Checkers/WebKit/forward-decl-checker.mm after https://github.com/llvm/llvm-project/pull/132784. #133341

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

rniwa
Copy link
Contributor

@rniwa rniwa commented Mar 27, 2025

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Mar 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 27, 2025

@llvm/pr-subscribers-clang-static-analyzer-1

@llvm/pr-subscribers-clang

Author: Ryosuke Niwa (rniwa)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/133341.diff

1 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp (+2-1)
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
index 291eb140d3202..a524593b0119b 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
@@ -231,7 +231,8 @@ class ForwardDeclChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
     if (BR->getSourceManager().isInSystemHeader(E->getExprLoc()))
       return;
 
-    if (auto *Receiver = E->getInstanceReceiver()->IgnoreParenCasts()) {
+    if (auto *Receiver = E->getInstanceReceiver()) {
+      Receiver = Receiver->IgnoreParenCasts();
       if (isUnknownType(E->getReceiverType()))
         reportUnknownRecieverType(Receiver, DeclWithIssue);
     }

@rniwa rniwa merged commit 2e3c317 into llvm:main Mar 27, 2025
10 of 11 checks passed
@rniwa rniwa deleted the fix-forward-decl-checker-after-pr-132784 branch March 27, 2025 23:45
rniwa added a commit to rniwa/llvm-project that referenced this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants