[PATCH] D95734: Use alias analysis to remove redundant instrumentation for Asan

Chijin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 6 20:53:02 PST 2021


ChijinZ added a comment.

In D95734#2544486 <https://reviews.llvm.org/D95734#2544486>, @vitalybuka wrote:

> how do we know that a function, in this case sin(), didn't release the buffer?

Do you mean a function returns a pointer but releases the buffer before returning? Think about another case:

  int* func2();
  int main() {
     ...
     int *p = func2();
     a[i] += *p;
     ...
  }

regarding the statement a[i] += *p , asan will first check *p is safe, and then check a[i] is safe. but it doesn't need to check a[i] if a[i] has been checked before.


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

https://reviews.llvm.org/D95734



More information about the llvm-commits mailing list