[PATCH] D103002: [libunwind] Inform ASan that resumption is noreturn

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 09:32:26 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGadf1561d6ce8: [libunwind] Inform ASan that resumption is noreturn (authored by smeenai).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103002/new/

https://reviews.llvm.org/D103002

Files:
  libunwind/src/libunwind.cpp


Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -16,6 +16,9 @@
 
 #include <stdlib.h>
 
+#if __has_feature(address_sanitizer)
+#include <sanitizer/asan_interface.h>
+#endif
 
 #if !defined(__USING_SJLJ_EXCEPTIONS__)
 #include "AddressSpace.hpp"
@@ -184,6 +187,10 @@
 /// Resume execution at cursor position (aka longjump).
 _LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {
   _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));
+#if __has_feature(address_sanitizer)
+  // Inform the ASan runtime that now might be a good time to clean stuff up.
+  __asan_handle_no_return();
+#endif
   AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
   co->jumpto();
   return UNW_EUNSPEC;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103002.347998.patch
Type: text/x-patch
Size: 843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210526/9e5d218e/attachment.bin>


More information about the llvm-commits mailing list