[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6e0c44174823: [NFC][CLANG] Fix nullptr dereference found by Coverity static analysis tool (authored by Manna). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
Manna added a comment. Thanks @erichkeane for reviews! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149922/new/ https://reviews.llvm.org/D149922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
Manna added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:2862 - if (Ty->isMemberPointerType()) { -const auto *MPT = Ty->getAs(); + if (const auto *MPT = Ty->getAs()) { return !ABI->getMemberPointerInfo(MPT).HasPadding; erichkeane wrote:

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
Manna updated this revision to Diff 519868. Manna marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149922/new/ https://reviews.llvm.org/D149922 Files: clang/lib/AST/ASTContext.cpp Index: clang/lib/AST/ASTContext.cpp =

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:2862 - if (Ty->isMemberPointerType()) { -const auto *MPT = Ty->getAs(); + if (const auto *MPT = Ty->getAs()) { return !ABI->getMemberPointerInfo(MPT).HasPadding; Remove the cu

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
Manna updated this revision to Diff 519859. Manna added a comment. I have updated patch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149922/new/ https://reviews.llvm.org/D149922 Files: clang/lib/AST/ASTContext.cpp Index: clang/lib/AST/ASTContext.cpp ===

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Soumi Manna via Phabricator via cfe-commits
Manna added a comment. In D149922#4321972 , @erichkeane wrote: > Looks like both ABIs that use this assume the parameter passed to > `getMemberPointerInfo` is non-null. While we DO check the type (in reality, > we probably should be doing a `if (const

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Looks like both ABIs that use this assume the parameter passed to `getMemberPointerInfo` is non-null. While we DO check the type (in reality, we probably should be doing a `if (const auto *MPT = Ty->getAs())` instead, I think this is a problem that at least SHOULD

[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

2023-05-04 Thread Soumi Manna via Phabricator via cfe-commits
Manna created this revision. Manna added a reviewer: erichkeane. Herald added a project: All. Manna requested review of this revision. Herald added a project: clang. Reported by Coverity: In clang::​ASTContext::​hasUniqueObjectRepresentations(clang::​QualType, bool): Return value of function w