[compiler-rt] r267376 - [esan] Fix uninitialized warning from interception context

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 24 20:56:22 PDT 2016


Author: bruening
Date: Sun Apr 24 22:56:20 2016
New Revision: 267376

URL: http://llvm.org/viewvc/llvm-project?rev=267376&view=rev
Log:
[esan] Fix uninitialized warning from interception context

The interception context is not used by esan, but the compiler complains
about it being uninitialized all the same.  We set it to null to avoid the
warning.

Modified:
    compiler-rt/trunk/lib/esan/esan_interceptors.cpp

Modified: compiler-rt/trunk/lib/esan/esan_interceptors.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/esan/esan_interceptors.cpp?rev=267376&r1=267375&r2=267376&view=diff
==============================================================================
--- compiler-rt/trunk/lib/esan/esan_interceptors.cpp (original)
+++ compiler-rt/trunk/lib/esan/esan_interceptors.cpp Sun Apr 24 22:56:20 2016
@@ -44,11 +44,13 @@ using namespace __esan; // NOLINT
 
 #define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name)
 
+// We currently do not use ctx.
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...)                               \
   do {                                                                         \
     if (UNLIKELY(COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)) {                 \
       return REAL(func)(__VA_ARGS__);                                          \
     }                                                                          \
+    ctx = nullptr;                                                             \
     (void)ctx;                                                                 \
   } while (false)
 




More information about the llvm-commits mailing list