Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: include/core/SkTDArray.h

Issue 1510683002: Add sk_careful_memcpy to catch undefined behavior in memcpy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: two more Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkTDArray.h
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h
index 26c6c7f8956b6cb1cdd80eaad35af7ee774f47bd..381eb1ae0e67e3cfb099009556724c1eda3cd29d 100644
--- a/include/core/SkTDArray.h
+++ b/include/core/SkTDArray.h
@@ -44,7 +44,7 @@ public:
if (src.fCount > fReserve) {
SkTDArray<T> tmp(src.fArray, src.fCount);
this->swap(tmp);
- } else {
+ } else if (src.fArray) {
tomhudson 2015/12/08 16:31:40 Do we not need to invalidate the current contents
memcpy(fArray, src.fArray, sizeof(T) * src.fCount);
fCount = src.fCount;
}
« include/core/SkTArray.h ('K') | « include/core/SkTArray.h ('k') | src/core/SkPathRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698