Index: compiler-rt/lib/asan/asan_thread.h =================================================================== --- compiler-rt/lib/asan/asan_thread.h +++ compiler-rt/lib/asan/asan_thread.h @@ -103,6 +103,8 @@ t->Destroy(tid); } + void Restart(); + void StartSwitchFiber(FakeStack **fake_stack_save, uptr bottom, uptr size); void FinishSwitchFiber(FakeStack *fake_stack_save, uptr *bottom_old, uptr *size_old); Index: compiler-rt/lib/asan/asan_thread.cc =================================================================== --- compiler-rt/lib/asan/asan_thread.cc +++ compiler-rt/lib/asan/asan_thread.cc @@ -115,6 +115,14 @@ DTLS_Destroy(); } +void AsanThread::Restart() { + // Thread restart is a feature on RTEMS, where a thread may resume + // execution at an arbitrary function entry point, withbut its stack + // and TLS state reset. This function handles the associated + // bookkeeping. + PoisonShadow(stack_bottom_, stack_top_ - stack_bottom_, 0); +} + void AsanThread::StartSwitchFiber(FakeStack **fake_stack_save, uptr bottom, uptr size) { if (atomic_load(&stack_switching_, memory_order_relaxed)) {