[compiler-rt] [compiler-rt][hwasan] Add fiber switch for HwASan (PR #153822)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 15 21:53:57 PDT 2025
================
@@ -119,6 +119,60 @@ void Thread::Destroy() {
*GetCurrentThreadLongPtr() = 0;
}
+void Thread::StartSwitchFiber(uptr bottom, uptr size) {
+ if (atomic_load(&stack_switching_, memory_order_relaxed)) {
+ Report("ERROR: starting fiber switch while in fiber switch\n");
+ Die();
+ }
+
+ next_stack_bottom_ = bottom;
+ next_stack_top_ = bottom + size;
+ atomic_store(&stack_switching_, 1, memory_order_release);
+}
+
+void Thread::FinishSwitchFiber(uptr *bottom_old, uptr *size_old) {
+ if (!atomic_load(&stack_switching_, memory_order_relaxed)) {
----------------
Tomahawkd wrote:
Fixed both `Thread::StartSwitchFiber` and `Thread::FinishSwitchFiber`
https://github.com/llvm/llvm-project/pull/153822
More information about the llvm-commits
mailing list