[PATCH] D156618: [IR] Fix a memory leak in Function::dropAllReferences()

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 11:48:21 PDT 2023


dexonsmith added a comment.

Seems unfortunate to add calls to `ConstantPointerNull::get()` when all of the callers are about to call `delete`.

Can we instead somehow enforce that `delete` is always called right after? Perhaps add an assertion that this is so?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156618



More information about the llvm-commits mailing list