From abdefea6a21a26748d4237b70b3f78f29143291b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Oct 2021 16:37:11 +0200 Subject: [PATCH] tsan: tidy up SCOPED_INTERCEPTOR_RAW Don't leak caller_pc var from the macro (it's not supposed to be used by interceptors). Use UNUSED instead of (void) cast. Depends on D112540. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D112541 --- compiler-rt/lib/tsan/rtl/tsan_interceptors.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.h b/compiler-rt/lib/tsan/rtl/tsan_interceptors.h index a772854..3886a30 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.h +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.h @@ -38,12 +38,10 @@ inline bool in_symbolizer() { } // namespace __tsan -#define SCOPED_INTERCEPTOR_RAW(func, ...) \ - ThreadState *thr = cur_thread_init(); \ - const uptr caller_pc = GET_CALLER_PC(); \ - ScopedInterceptor si(thr, #func, caller_pc); \ - const uptr pc = GET_CURRENT_PC(); \ - (void)pc; +#define SCOPED_INTERCEPTOR_RAW(func, ...) \ + ThreadState *thr = cur_thread_init(); \ + ScopedInterceptor si(thr, #func, GET_CALLER_PC()); \ + UNUSED const uptr pc = GET_CURRENT_PC(); #define SCOPED_TSAN_INTERCEPTOR(func, ...) \ SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__); \ -- 2.7.4