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

Side by Side Diff: Source/platform/heap/Heap.cpp

Issue 547903002: Oilpan: blink_heap_unittests: asan check failed. HeapObjectHeader::finalize zap a wrong memory for … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 #if ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) 478 #if ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
479 // In Debug builds, memory is zapped when it's freed, and the zapped memory is 479 // In Debug builds, memory is zapped when it's freed, and the zapped memory is
480 // zeroed out when the memory is reused. Memory is also zapped when using Le ak 480 // zeroed out when the memory is reused. Memory is also zapped when using Le ak
481 // Sanitizer because the heap is used as a root region for LSan and therefor e 481 // Sanitizer because the heap is used as a root region for LSan and therefor e
482 // pointers in unreachable memory could hide leaks. 482 // pointers in unreachable memory could hide leaks.
483 for (size_t i = 0; i < objectSize; i++) 483 for (size_t i = 0; i < objectSize; i++)
484 object[i] = finalizedZapValue; 484 object[i] = finalizedZapValue;
485 485
486 // Zap the primary vTable entry (secondary vTable entries are not zapped). 486 // Zap the primary vTable entry (secondary vTable entries are not zapped).
487 *(reinterpret_cast<uintptr_t*>(object)) = zappedVTable; 487 if (gcInfo->hasVTable()) {
488 *(reinterpret_cast<uintptr_t*>(object)) = zappedVTable;
489 }
488 #endif 490 #endif
489 // In Release builds, the entire object is zeroed out when it is added to th e free list. 491 // In Release builds, the entire object is zeroed out when it is added to th e free list.
490 // This happens right after sweeping the page and before the thread commence s execution. 492 // This happens right after sweeping the page and before the thread commence s execution.
491 } 493 }
492 494
493 NO_SANITIZE_ADDRESS 495 NO_SANITIZE_ADDRESS
494 void FinalizedHeapObjectHeader::finalize() 496 void FinalizedHeapObjectHeader::finalize()
495 { 497 {
496 HeapObjectHeader::finalize(m_gcInfo, payload(), payloadSize()); 498 HeapObjectHeader::finalize(m_gcInfo, payload(), payloadSize());
497 } 499 }
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 CallbackStack* Heap::s_markingStack; 2848 CallbackStack* Heap::s_markingStack;
2847 CallbackStack* Heap::s_postMarkingCallbackStack; 2849 CallbackStack* Heap::s_postMarkingCallbackStack;
2848 CallbackStack* Heap::s_weakCallbackStack; 2850 CallbackStack* Heap::s_weakCallbackStack;
2849 CallbackStack* Heap::s_ephemeronStack; 2851 CallbackStack* Heap::s_ephemeronStack;
2850 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; 2852 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
2851 bool Heap::s_shutdownCalled = false; 2853 bool Heap::s_shutdownCalled = false;
2852 bool Heap::s_lastGCWasConservative = false; 2854 bool Heap::s_lastGCWasConservative = false;
2853 FreePagePool* Heap::s_freePagePool; 2855 FreePagePool* Heap::s_freePagePool;
2854 OrphanedPagePool* Heap::s_orphanedPagePool; 2856 OrphanedPagePool* Heap::s_orphanedPagePool;
2855 } 2857 }
OLDNEW
« 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