[llvm-commits] [compiler-rt] r159431 - /compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Dmitry Vyukov
dvyukov at google.com
Fri Jun 29 08:26:55 PDT 2012
Author: dvyukov
Date: Fri Jun 29 10:26:55 2012
New Revision: 159431
URL: http://llvm.org/viewvc/llvm-project?rev=159431&view=rev
Log:
tsan: replace struct copies where clang inserts memcpy() calls with explicit internal_memcpy() calls
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=159431&r1=159430&r2=159431&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri Jun 29 10:26:55 2012
@@ -1304,9 +1304,9 @@
signal->armed = true;
signal->sigaction = sigact;
if (info)
- signal->siginfo = *info;
+ internal_memcpy(&signal->siginfo, info, sizeof(*info));
if (ctx)
- signal->ctx = *(ucontext_t*)ctx;
+ internal_memcpy(&signal->ctx, ctx, sizeof(signal->ctx));
sctx->pending_signal_count++;
}
}
@@ -1322,11 +1322,12 @@
TSAN_INTERCEPTOR(int, sigaction, int sig, sigaction_t *act, sigaction_t *old) {
SCOPED_TSAN_INTERCEPTOR(sigaction, sig, act, old);
if (old)
- *old = sigactions[sig];
+ internal_memcpy(old, &sigactions[sig], sizeof(*old));
if (act == 0)
return 0;
- sigactions[sig] = *act;
- sigaction_t newact = *act;
+ internal_memcpy(&sigactions[sig], act, sizeof(*act));
+ sigaction_t newact;
+ internal_memcpy(&newact, act, sizeof(newact));
sigfillset(&newact.sa_mask);
if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL) {
if (newact.sa_flags & SA_SIGINFO)
More information about the llvm-commits
mailing list