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

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

Issue 2464273002: Fix ThreadHeap::isHeapObjectAlive(const T*& ptr) stack overflow. (Closed)
Patch Set: Fix test. Created 4 years, 1 month 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 | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Heap.h
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h
index 43c6c11123cc9275880561efd220b11accb6693a..553de93e033a5fdfc11c2186b357a084f9cc1954 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.h
+++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -93,7 +93,7 @@ class ObjectAliveTrait<T, false> {
STATIC_ONLY(ObjectAliveTrait);
public:
- static bool isHeapObjectAlive(T* object) {
+ static bool isHeapObjectAlive(const T* object) {
static_assert(sizeof(T), "T must be fully defined");
return HeapObjectHeader::fromPayload(object)->isMarked();
}
@@ -105,7 +105,7 @@ class ObjectAliveTrait<T, true> {
public:
NO_SANITIZE_ADDRESS
- static bool isHeapObjectAlive(T* object) {
+ static bool isHeapObjectAlive(const T* object) {
static_assert(sizeof(T), "T must be fully defined");
return object->isHeapObjectAlive();
}
@@ -238,7 +238,7 @@ class PLATFORM_EXPORT ThreadHeap {
#endif
template <typename T>
- static inline bool isHeapObjectAlive(T* object) {
+ static inline bool isHeapObjectAlive(const T* object) {
static_assert(sizeof(T), "T must be fully defined");
// The strongification of collections relies on the fact that once a
// collection has been strongified, there is no way that it can contain
@@ -268,10 +268,6 @@ class PLATFORM_EXPORT ThreadHeap {
static inline bool isHeapObjectAlive(const UntracedMember<T>& member) {
return isHeapObjectAlive(member.get());
}
- template <typename T>
- static inline bool isHeapObjectAlive(const T*& ptr) {
- return isHeapObjectAlive(ptr);
- }
StackFrameDepth& stackFrameDepth() { return m_stackFrameDepth; }
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698