Title: [284092] trunk/Source/WTF
Revision
284092
Author
[email protected]
Date
2021-10-13 07:33:06 -0700 (Wed, 13 Oct 2021)

Log Message

CLang build warning in CheckedPtr.h
https://bugs.webkit.org/show_bug.cgi?id=231672

Patch by Philippe Normand <[email protected]> on 2021-10-13
Reviewed by Alex Christensen.

Assert on the wrapped pointer. Asserting on `this` always results to true, defeating the
purpose of the ASSERT.

* wtf/CheckedPtr.h:
(WTF::CheckedPtr::operator* const):
(WTF::CheckedPtr::operator*):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (284091 => 284092)


--- trunk/Source/WTF/ChangeLog	2021-10-13 13:56:48 UTC (rev 284091)
+++ trunk/Source/WTF/ChangeLog	2021-10-13 14:33:06 UTC (rev 284092)
@@ -1,3 +1,17 @@
+2021-10-13  Philippe Normand  <[email protected]>
+
+        CLang build warning in CheckedPtr.h
+        https://bugs.webkit.org/show_bug.cgi?id=231672
+
+        Reviewed by Alex Christensen.
+
+        Assert on the wrapped pointer. Asserting on `this` always results to true, defeating the
+        purpose of the ASSERT.
+
+        * wtf/CheckedPtr.h:
+        (WTF::CheckedPtr::operator* const):
+        (WTF::CheckedPtr::operator*):
+
 2021-10-12  Alex Christensen  <[email protected]>
 
         Use std::variant instead of WTF::Variant

Modified: trunk/Source/WTF/wtf/CheckedPtr.h (284091 => 284092)


--- trunk/Source/WTF/wtf/CheckedPtr.h	2021-10-13 13:56:48 UTC (rev 284091)
+++ trunk/Source/WTF/wtf/CheckedPtr.h	2021-10-13 14:33:06 UTC (rev 284092)
@@ -105,8 +105,8 @@
 
     ALWAYS_INLINE const T* get() const { return PtrTraits::unwrap(m_ptr); }
     ALWAYS_INLINE T* get() { return PtrTraits::unwrap(m_ptr); }
-    ALWAYS_INLINE const T& operator*() const { ASSERT(this); return *get(); }
-    ALWAYS_INLINE T& operator*() { ASSERT(this); return *get(); }
+    ALWAYS_INLINE const T& operator*() const { ASSERT(m_ptr); return *get(); }
+    ALWAYS_INLINE T& operator*() { ASSERT(m_ptr); return *get(); }
     ALWAYS_INLINE const T* operator->() const { return get(); }
     ALWAYS_INLINE T* operator->() { return get(); }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to