[compiler-rt] r261909 - [Sanitizer] Protect against compiler-inserted memcpy() in InternalMmapVector::push_back().

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 10:12:30 PST 2016


Author: samsonov
Date: Thu Feb 25 12:12:30 2016
New Revision: 261909

URL: http://llvm.org/viewvc/llvm-project?rev=261909&view=rev
Log:
[Sanitizer] Protect against compiler-inserted memcpy() in InternalMmapVector::push_back().

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=261909&r1=261908&r2=261909&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Thu Feb 25 12:12:30 2016
@@ -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);




More information about the llvm-commits mailing list