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

Unified Diff: cc/base/list_container.h

Issue 1359693002: CFI: avoid a bad cast in InsertBeforeAndInvalidateAllPointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed another instance Created 5 years, 3 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/list_container.h
diff --git a/cc/base/list_container.h b/cc/base/list_container.h
index ec9c62dce52a7838bace6307cc0cdb3757a1a0e3..d5907407c0adc38d9fcf8c29f41233322f8cddeb 100644
--- a/cc/base/list_container.h
+++ b/cc/base/list_container.h
@@ -124,7 +124,7 @@ class ListContainer {
template <typename DerivedElementType>
DerivedElementType* ReplaceExistingElement(Iterator at) {
at->~BaseElementType();
- return new (*at) DerivedElementType();
+ return new (at.item_iterator) DerivedElementType();
}
// Insert |count| new elements of |DerivedElementType| before |at|. This will
@@ -135,7 +135,7 @@ class ListContainer {
helper_.InsertBeforeAndInvalidateAllPointers(&at, count);
Iterator result = at;
for (size_t i = 0; i < count; ++i) {
- new (*at) DerivedElementType();
+ new (at.item_iterator) DerivedElementType();
++at;
}
return result;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698