diff options
author | Kostya Serebryany <kcc@google.com> | 2014-04-14 11:16:53 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-04-14 11:16:53 +0000 |
commit | 2c3f6b772a8da6795c49d838cfa7389b402281e8 (patch) | |
tree | f7eae79078c41e5cd66148dc5eb62bf0a2088c50 /include | |
parent | 55e41c8ea5352062576d7ce3bfd90829a00d9b25 (diff) |
[asan] don't use bool in public interface, make sure the interface headers are usable in plain C
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/asan_interface.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h index 045ca954b..d244346e4 100644 --- a/include/sanitizer/asan_interface.h +++ b/include/sanitizer/asan_interface.h @@ -50,9 +50,10 @@ extern "C" { ((void)(addr), (void)(size)) #endif - // Returns true iff addr is poisoned (i.e. 1-byte read/write access to this + // Returns 1 if addr is poisoned (i.e. 1-byte read/write access to this // address will result in error report from AddressSanitizer). - bool __asan_address_is_poisoned(void const volatile *addr); + // Otherwise returns 0. + int __asan_address_is_poisoned(void const volatile *addr); // If at least on byte in [beg, beg+size) is poisoned, return the address // of the first such byte. Otherwise return 0. @@ -65,7 +66,7 @@ extern "C" { // However it is still a part of the interface because users may want to // set a breakpoint on this function in a debugger. void __asan_report_error(void *pc, void *bp, void *sp, - void *addr, bool is_write, size_t access_size); + void *addr, int is_write, size_t access_size); // Sets the exit code to use when reporting an error. // Returns the old value. @@ -87,9 +88,9 @@ extern "C" { // memory, returns the maximal possible allocation size, otherwise returns // "size". size_t __asan_get_estimated_allocated_size(size_t size); - // Returns true if p was returned by the ASan allocator and - // is not yet freed. - bool __asan_get_ownership(const void *p); + // Returns 1 if p was returned by the ASan allocator and is not yet freed. + // Otherwise returns 0. + int __asan_get_ownership(const void *p); // Returns the number of bytes reserved for the pointer p. // Requires (get_ownership(p) == true) or (p == 0). size_t __asan_get_allocated_size(const void *p); |