diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2016-09-28 12:28:16 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2016-09-28 12:28:16 +0000 |
commit | 0b95585616bd28fc0b738289bcc5f7887d7c304e (patch) | |
tree | cb1b4a0eb19b6f8d8b49d99128d612f0e9b5d052 /include/sanitizer/common_interface_defs.h | |
parent | 6eef723e08d4d943cbe9221c0709404e194e20f9 (diff) | |
download | compiler-rt-0b95585616bd28fc0b738289bcc5f7887d7c304e.tar.gz |
[ASAN] Pass previous stack information through __sanitizer_finish_switch_fiber
This patch extends __sanitizer_finish_switch_fiber method to optionally return previous stack base and size.
This solves the problem of coroutines/fibers library not knowing the original stack context from which the library is used. It's incorrect to assume that such context is always the default stack of current thread (e.g. one such library may be used from a fiber/coroutine created by another library). Bulding a separate stack tracking mechanism would not only duplicate AsanThread, but also require each coroutines/fibers library to integrate with it.
Author: Andrii Grynenko (andriigrynenko)
Reviewed in: https://reviews.llvm.org/D24628
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/sanitizer/common_interface_defs.h')
-rw-r--r-- | include/sanitizer/common_interface_defs.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h index d8ff272c2..130f0f27a 100644 --- a/include/sanitizer/common_interface_defs.h +++ b/include/sanitizer/common_interface_defs.h @@ -179,7 +179,9 @@ extern "C" { // use-after-return detection. void __sanitizer_start_switch_fiber(void **fake_stack_save, const void *bottom, size_t size); - void __sanitizer_finish_switch_fiber(void *fake_stack_save); + void __sanitizer_finish_switch_fiber(void *fake_stack_save, + const void **bottom_old, + size_t *size_old); #ifdef __cplusplus } // extern "C" #endif |