diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/asan_interface.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h index a943cfe34..045ca954b 100644 --- a/include/sanitizer/asan_interface.h +++ b/include/sanitizer/asan_interface.h @@ -122,6 +122,24 @@ extern "C" { // deallocation of "ptr". void __asan_malloc_hook(void *ptr, size_t size); void __asan_free_hook(void *ptr); + + // The following 2 functions facilitate garbage collection in presence of + // asan's fake stack. + + // Returns an opaque handler to be used later in __asan_addr_is_in_fake_stack. + // Returns NULL if the current thread does not have a fake stack. + void *__asan_get_current_fake_stack(); + + // If fake_stack is non-NULL and addr belongs to a fake frame in + // fake_stack, returns the address on real stack that corresponds to + // the fake frame and sets beg/end to the boundaries of this fake frame. + // Otherwise returns NULL and does not touch beg/end. + // If beg/end are NULL, they are not touched. + // This function may be called from a thread other than the owner of + // fake_stack, but the owner thread need to be alive. + void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg, + void **end); + #ifdef __cplusplus } // extern "C" #endif |