[PATCH] [clang/asan] call __asan_poison_cxx_array_cookie after operator new[]

Alexey Samsonov vonosmas at gmail.com
Thu Aug 21 13:18:14 PDT 2014


I thought of one more test case we should add:

  __attribute__((no_sanitize_address))
  int *createArray(int n) {
    return new int[n];
  }

  int bad_access() {  
    int *array = createArray(4);
    return array[-1];
  }
  
We certainly want to print an error in this case, even though we have attribute on createArray() function. I believe current code *would* handle this correctly, but let's test this behavior.

http://reviews.llvm.org/D4774






More information about the cfe-commits mailing list