[PATCH] D89191: [ASAN] Make sure we are only processing lifetime markers with offset 0 to alloca

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 23:18:41 PDT 2020


lxfind added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1083
+    // beginning of the alloca.
+    AllocaInst *AI = findAllocaForValue(II.getArgOperand(1), true);
     if (!AI) {
----------------
vitalybuka wrote:
> lxfind wrote:
> > lxfind wrote:
> > > vitalybuka wrote:
> > > > Similar problem is if the size of lifetime is smaller then alloca.
> > > > Would you like to handle that case, here or in the another patch? 
> > > Is that a problem though? A lifetime marker should always be accurate, that is, if the marker indicates that only part of the region is alive, it should be ok to just mark that region alive?
> > I will land this as it is for now. But please do let me know your thoughts on what we want to do when the size doesn't match.
> if marker can point with offset, skipping the beginning of the alloca, then I assume sooner or later something may generate code which will set size smaller then alloca, skipping the tail of it.
Not sure if I follow, but my point is if the lifetime points to the beginning of the alloca, the generated instrumentation code will always be correct, and hence it's fine even the size may be smaller than the alloca size.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89191



More information about the llvm-commits mailing list