[PATCH] D105201: [hwasan] Detect use after scope within function.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 14:36:48 PDT 2021


eugenis added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h:52
+template <typename F>
+void tagLifetimeEnd(DominatorTree *DT, PostDominatorTree *PDT,
+                    IntrinsicInst *Start, IntrinsicInst *End,
----------------
fmayer wrote:
> eugenis wrote:
> > tagLifetimeEnd is not descriptive enough for namespace llvm. M/b something like ForAllReachableExits? Start and End can be just Instruction *, and RetVec should be const. Instead of erasing End I'd rather return a bool that's true if any callbacks were invoked on any of the RetVec, and caller can remove lifetime.end then.
> > 
> > This refactoring is better done in a separate change.
> > This refactoring is better done in a separate change.
> 
> Confirming that you mean I should split this change and pull this helper function out before?
yes


================
Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:124
+                    cl::desc("detect use after scope within function"),
+                    cl::Hidden, cl::init(false));
+
----------------
fmayer wrote:
> eugenis wrote:
> > Probably should be on by default.
> Wouldn't it be prudent to leave it behind a disabled flag until we get some more experience, and then make it opt-out?
hmm ok lets start with that


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105201



More information about the llvm-commits mailing list