[compiler-rt] r261073 - [compiler-rt][msan] Ensure initialisation before calling __msan_unpoison

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 23:12:18 PST 2016


Author: hahnfeld
Date: Wed Feb 17 01:12:18 2016
New Revision: 261073

URL: http://llvm.org/viewvc/llvm-project?rev=261073&view=rev
Log:
[compiler-rt][msan] Ensure initialisation before calling __msan_unpoison

__msan_unpoison uses intercepted memset which currently leads to a SEGV
when linking with libc++ under CentOS 7.

Differential Revision: http://reviews.llvm.org/D17263

Modified:
    compiler-rt/trunk/lib/msan/msan_interceptors.cc

Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=261073&r1=261072&r2=261073&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Wed Feb 17 01:12:18 2016
@@ -1433,12 +1433,12 @@ int OnExit() {
   __msan_unpoison(ptr, size)
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...)                  \
   if (msan_init_is_running) return REAL(func)(__VA_ARGS__);       \
+  ENSURE_MSAN_INITED();                                           \
   MSanInterceptorContext msan_ctx = {IsInInterceptorScope()};     \
   ctx = (void *)&msan_ctx;                                        \
   (void)ctx;                                                      \
   InterceptorScope interceptor_scope;                             \
-  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */  \
-  ENSURE_MSAN_INITED();
+  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */
 #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
   do {                                            \
   } while (false)




More information about the llvm-commits mailing list