[PATCH] D25946: [compiler-rt][asan] Add support for desallocation of unhandled pointers

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 09:33:13 PDT 2016


rnk added inline comments.


================
Comment at: lib/asan/asan_allocator.cc:555
+    // coverage.
+    if (!get_allocator().PointerIsMine(ptr))
+      return;
----------------
IMO it's a bug if we get here and !PointerIsMine. The primary allocator check is pretty fast, but checking the secondary allocator is a linear search I think.

We can probably move this check to the HeapFree interceptor in asan_malloc_win.cc if we need it, though. That's probably only called by the CRT, which isn't usually hot. It also keeps Windows heap interception concerns out of the main allocator logic.


https://reviews.llvm.org/D25946





More information about the llvm-commits mailing list