From 07f9c0f558cb391ecf083dbee83fe1f5e1c0ab32 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Thu, 25 Feb 2016 18:12:30 +0000 Subject: [PATCH] [Sanitizer] Protect against compiler-inserted memcpy() in InternalMmapVector::push_back(). llvm-svn: 261909 --- compiler-rt/lib/sanitizer_common/sanitizer_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h index f997f92..7fb8c2e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -510,7 +510,7 @@ class InternalMmapVectorNoCtor { uptr new_capacity = RoundUpToPowerOfTwo(size_ + 1); Resize(new_capacity); } - data_[size_++] = element; + internal_memcpy(&data_[size_++], &element, sizeof(T)); } T &back() { CHECK_GT(size_, 0); -- 2.7.4