| Index: third_party/WebKit/Source/platform/heap/HeapAllocator.h
|
| diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.h b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
|
| index b60817ca43d88cc1c4c35b490e82b22667ef8c9c..765113be0132ce3988d7ebc4de497b3f6628254c 100644
|
| --- a/third_party/WebKit/Source/platform/heap/HeapAllocator.h
|
| +++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
|
| @@ -306,9 +306,11 @@ void HeapVectorBacking<T, Traits>::finalize(void* pointer) {
|
| ANNOTATE_CHANGE_SIZE(buffer, length, 0, length);
|
| #endif
|
| if (std::is_polymorphic<T>::value) {
|
| + char* pointer = reinterpret_cast<char*>(buffer);
|
| for (unsigned i = 0; i < length; ++i) {
|
| - if (blink::vTableInitialized(&buffer[i]))
|
| - buffer[i].~T();
|
| + char* element = pointer + i * sizeof(T);
|
| + if (blink::vTableInitialized(element))
|
| + reinterpret_cast<T*>(element)->~T();
|
| }
|
| } else {
|
| for (unsigned i = 0; i < length; ++i) {
|
|
|