[webkit-changes] [WebKit/WebKit] 1b44f3: Make sure Markable is set when dereferencing it an...
Chris Dumez
noreply at github.com
Sun Aug 18 20:08:55 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1b44f3a2465f6e00b2edf81879dd953241673700
https://github.com/WebKit/WebKit/commit/1b44f3a2465f6e00b2edf81879dd953241673700
Author: Chris Dumez <cdumez at apple.com>
Date: 2024-08-18 (Sun, 18 Aug 2024)
Changed paths:
M Source/WTF/wtf/Markable.h
M Source/WebCore/platform/graphics/FontSizeAdjust.h
M Source/WebGPU/WGSL/Overload.cpp
M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
Log Message:
-----------
Make sure Markable is set when dereferencing it and getting its value
https://bugs.webkit.org/show_bug.cgi?id=278296
Reviewed by Dan Glastonbury.
Make sure WTF::Markable is set when dereferencing it and getting its value,
similarly to what is done with std::optional. We currently have no check so
you can dereference an unset Markable and get an unexpected value. This
matters a lot when using Markable with ObjectIdentifier for example.
ObjectIdentifier is expected to be a valid identifier, however, you can
easily get can invalid ObjectIdentifier if it was stored in a Markable.
This tested as performance neutral on the benchmarks we track.
* Source/WTF/wtf/Markable.h:
(WTF::Markable::value const):
(WTF::Markable::value):
(WTF::Markable::unsafeValue const):
(WTF::Markable::unsafeValue):
(WTF::Markable::operator-> const):
(WTF::Markable::operator->):
(WTF::Markable::operator* const):
(WTF::Markable::operator*):
* Source/WebCore/platform/graphics/FontSizeAdjust.h:
(WebCore::add):
* Source/WebGPU/WGSL/Overload.cpp:
(WGSL::OverloadResolver::unify):
(WGSL::OverloadResolver::conversionRank const):
Canonical link: https://commits.webkit.org/282412@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