From e6c2c0853f57f4f49be62cd654acbe25ecae6280 Mon Sep 17 00:00:00 2001 From: Alessio Bazzica Date: Thu, 8 Nov 2018 12:20:55 +0100 Subject: [PATCH] MsanUninitialized: restric type check to msan case. This change is needed to avoid undesired failures caused by IsTriviallyCopyable behavior differences across different compilers and STL implementations. It will allow https://webrtc-review.googlesource.com/c/src/+/40300 to land. Bug: webrtc:8762 Change-Id: Ide32062605320c706b8a2f3f149d73b967b1fe30 Reviewed-on: https://webrtc-review.googlesource.com/c/110143 Reviewed-by: Karl Wiberg Commit-Queue: Alessio Bazzica Cr-Commit-Position: refs/heads/master@{#25560} --- rtc_base/sanitizer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtc_base/sanitizer.h b/rtc_base/sanitizer.h index 23a748f84f..a9eccfcc94 100644 --- a/rtc_base/sanitizer.h +++ b/rtc_base/sanitizer.h @@ -123,9 +123,11 @@ inline void MsanMarkUninitialized(const T& mem) { template inline T MsanUninitialized(T t) { +#if RTC_HAS_MSAN // TODO(bugs.webrtc.org/8762): Switch to std::is_trivially_copyable when it // becomes available in downstream projects. static_assert(sanitizer_impl::IsTriviallyCopyable(), ""); +#endif rtc_MsanMarkUninitialized(&t, sizeof(T), 1); return t; }