[PATCH] D37229: When built with ASan, __cxa_throw calls __asan_handle_no_return

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 19:46:13 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL312606: [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return (authored by phosek).

Changed prior to commit:
  https://reviews.llvm.org/D37229?vs=112948&id=113948#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37229

Files:
  libcxxabi/trunk/src/cxa_exception.cpp


Index: libcxxabi/trunk/src/cxa_exception.cpp
===================================================================
--- libcxxabi/trunk/src/cxa_exception.cpp
+++ libcxxabi/trunk/src/cxa_exception.cpp
@@ -19,6 +19,10 @@
 #include "cxa_handlers.hpp"
 #include "fallback_malloc.h"
 
+#if __has_feature(address_sanitizer)
+#include <sanitizer/asan_interface.h>
+#endif
+
 // +---------------------------+-----------------------------+---------------+
 // | __cxa_exception           | _Unwind_Exception CLNGC++\0 | thrown object |
 // +---------------------------+-----------------------------+---------------+
@@ -217,6 +221,12 @@
     globals->uncaughtExceptions += 1;   // Not atomically, since globals are thread-local
 
     exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
+
+#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
+
 #ifdef __USING_SJLJ_EXCEPTIONS__
     _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
 #else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37229.113948.patch
Type: text/x-patch
Size: 1069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170906/500e1cb3/attachment.bin>


More information about the llvm-commits mailing list