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

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 08:05:12 PDT 2023


Manna added a comment.

In D149922#4321972 <https://reviews.llvm.org/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 auto *MPT = Ty->getAs<MemberPointerType>())` instead, I think this is a problem that at least SHOULD be fixed somehow.
>
> Why was this abandoned?

@erichkeane, Sorry i abandoned the patch without any comment. My change (use castAs instead of getAs) was not correct.

>> 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<MemberPointerType>())` instead

Agreed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149922/new/

https://reviews.llvm.org/D149922



More information about the cfe-commits mailing list