Commit Graph

63 Commits

Author SHA1 Message Date
Alexander Potapenko 1bde28b464 Factor the common code out of cf_free and mz_free.
Introduce the mac_ignore_invalid_free flag (0 by default) which makes both cf_free and mz_free ignore invalid free invocations and leak memory.

llvm-svn: 158885
2012-06-21 01:01:20 +00:00
Alexander Potapenko f9f2fbacb3 Actually intercept free() to ensure that the deallocations caused by other functions directly calling it are routed to our allocator.
For the allocations that do not belong to any malloc zone check whether they're padded with a pointer to ASan's CFAllocator. If so, free the original (unpadded) pointer.
This should fix AddressSanitizerMac.NSURLDeallocation and issue 70.

llvm-svn: 158863
2012-06-20 22:29:09 +00:00
Alexey Samsonov 51ae983718 [Sanitizer]: Introduce a common internal printf function. For now, also use tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms).
llvm-svn: 158065
2012-06-06 13:11:29 +00:00
Alexey Samsonov 485d3dc363 Remove file-type tags for .cc files in ASan run-time library
llvm-svn: 157927
2012-06-04 13:50:10 +00:00
Kostya Serebryany 8d03204204 [asan] more renaming
llvm-svn: 157746
2012-05-31 14:35:53 +00:00
Alexander Potapenko c6eb6a8287 Add internal_memset and replace the uses of REAL(memset) with it where the performance allows.
llvm-svn: 153641
2012-03-29 12:20:47 +00:00
Eli Friedman e781266905 Make sure to properly ifdef out an unused function on OSX < 10.6. PR12136. Patch from Jeremy Huddleston.
llvm-svn: 152085
2012-03-06 01:21:14 +00:00
Alexey Samsonov 8489f2a564 AddressSanitizer: start factoring out interception machinery
llvm-svn: 150083
2012-02-08 19:52:01 +00:00
Alexey Samsonov e725478e2f AddressSanitizer: replace all "real_X" calls with "REAL(X)"
llvm-svn: 150073
2012-02-08 13:45:31 +00:00
Alexey Samsonov 209c514a1d AddressSanitizer: add support for malloc_usable_size() function
llvm-svn: 148287
2012-01-17 06:39:10 +00:00
Daniel Dunbar fc4a4a3cbc asan: #if 0 out some unused functions (we build with -Werror).
llvm-svn: 145645
2011-12-01 23:35:47 +00:00
Kostya Serebryany 5dfa4da0b9 [asan] flatten the asan-rt build slightly
llvm-svn: 145631
2011-12-01 21:40:52 +00:00
Kostya Serebryany 019b76f5fd AddressSanitizer run-time library. Not yet integrated with the compiler-rt build system, but can be built using the old makefile. See details in README.txt
llvm-svn: 145463
2011-11-30 01:07:02 +00:00