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

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: reed 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
« no previous file with comments | « include/core/SkTArray.h ('k') | include/core/SkTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTDArray.h
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h
index 26c6c7f8956b6cb1cdd80eaad35af7ee774f47bd..b5332a2cc4aa26d3648ed869c81c0063195dcd9b 100644
--- a/include/core/SkTDArray.h
+++ b/include/core/SkTDArray.h
@@ -45,7 +45,7 @@ public:
SkTDArray<T> tmp(src.fArray, src.fCount);
this->swap(tmp);
} else {
- memcpy(fArray, src.fArray, sizeof(T) * src.fCount);
+ sk_careful_memcpy(fArray, src.fArray, sizeof(T) * src.fCount);
fCount = src.fCount;
}
}
« no previous file with comments | « include/core/SkTArray.h ('k') | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698