[webkit-changes] [WebKit/WebKit] 00b215: Make CheckedPtr / CheckedRef dereferencing safer

Chris Dumez noreply at github.com
Sat Jan 11 13:49:53 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 00b2154f40135973fbf8bf313beb56797a5eeab7
      https://github.com/WebKit/WebKit/commit/00b2154f40135973fbf8bf313beb56797a5eeab7
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2025-01-11 (Sat, 11 Jan 2025)

  Changed paths:
    M Source/WTF/wtf/CheckedPtr.h
    M Source/WTF/wtf/CheckedRef.h

  Log Message:
  -----------
  Make CheckedPtr / CheckedRef dereferencing safer
https://bugs.webkit.org/show_bug.cgi?id=285788

Reviewed by Darin Adler.

Make CheckedPtr / CheckedRef dereferencing safer by RELEASE_ASSERT()
that the pointer is not null. This is important since null
dereferencing is undefined behavior.

This tested as performance neutral on Speedometer and JetStream.

* Source/WTF/wtf/CheckedPtr.h:
(WTF::CheckedPtr::operator* const):
* Source/WTF/wtf/CheckedRef.h:
(WTF::CheckedRef::get const):
(WTF::CheckedRef::operator-> const):
(WTF::CheckedRef::operator bool const):

Canonical link: https://commits.webkit.org/288764@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list