[PATCH] D150254: [tidy] Fix possible use-after-free in IdentifierNamingCheck

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 01:44:20 PDT 2023


njames93 added a comment.

In D150254#4331640 <https://reviews.llvm.org/D150254#4331640>, @kadircet wrote:

> see https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidy.cpp#L638 for such a pattern, clangd also initializes checks with a similar approach.

In this example the factory outlives the check so there is no possible use after free.

In regard to this change, I think that this member can actually be removed entirely as we can get the name of the check using the `getID` virtual function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150254



More information about the cfe-commits mailing list