[tbb-commits] [tor-browser/tor-browser-38.3.0esr-5.5-2] Bug 1147248 - GCC 4.9 needs this patch to use address sanitizer. r=glandium

gk at torproject.org gk at torproject.org
Thu Oct 29 20:57:26 UTC 2015


commit 4a90c975e0c251e073f5c218d72a8ce1a4087e97
Author: ISHIKAWA, Chiaki <ishikawa at yk.rim.or.jp>
Date:   Fri Apr 10 15:05:00 2015 +0200

    Bug 1147248 - GCC 4.9 needs this patch to use address sanitizer. r=glandium
    
    --HG--
    extra : rebase_source : 08c553d5b5ff76abd81b070ccd6e2f058a2c4e4b
---
 memory/mozalloc/mozalloc.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h
index 2b370ec..a1479ad 100644
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -203,7 +203,13 @@ MOZALLOC_EXPORT void* moz_valloc(size_t size)
 
 #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW
+#if defined(__GNUC__) && !defined(__clang__) && defined(__SANITIZE_ADDRESS__)
+/* gcc's asan somehow doesn't like always_inline on this function. */
+__attribute__((gnu_inline)) inline
+#else
+MOZALLOC_INLINE
+#endif
 void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC
 {
     return moz_xmalloc(size);





More information about the tbb-commits mailing list