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

Unified Diff: third_party/WebKit/Source/platform/heap/TraceTraits.h

Issue 2436123002: Fix CFI errors in Oilpan (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/Source/platform/heap/HeapAllocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/TraceTraits.h
diff --git a/third_party/WebKit/Source/platform/heap/TraceTraits.h b/third_party/WebKit/Source/platform/heap/TraceTraits.h
index a36afa7519082078dd6156294420219d46ee7840..da167596f5c877cd7dbccdaae2ff52215aabfe5e 100644
--- a/third_party/WebKit/Source/platform/heap/TraceTraits.h
+++ b/third_party/WebKit/Source/platform/heap/TraceTraits.h
@@ -491,8 +491,10 @@ struct TraceInCollectionTrait<NoWeakHandlingInCollections,
// elements to trace.
size_t length = header->payloadSize() / sizeof(T);
if (std::is_polymorphic<T>::value) {
- for (size_t i = 0; i < length; ++i) {
- if (blink::vTableInitialized(&array[i]))
+ char* pointer = reinterpret_cast<char*>(array);
+ for (unsigned i = 0; i < length; ++i) {
+ char* element = pointer + i * sizeof(T);
+ if (blink::vTableInitialized(element))
blink::TraceIfEnabled<
T, IsTraceableInCollectionTrait<Traits>::value>::trace(visitor,
array[i]);
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapAllocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698