[esan] Fix uninitialized warning from interception context
authorDerek Bruening <bruening@google.com>
Mon, 25 Apr 2016 03:56:20 +0000 (03:56 +0000)
committerDerek Bruening <bruening@google.com>
Mon, 25 Apr 2016 03:56:20 +0000 (03:56 +0000)
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.

llvm-svn: 267376

compiler-rt/lib/esan/esan_interceptors.cpp

index 3973aa4..6c535c5 100644 (file)
@@ -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)