[webkit-changes] [WebKit/WebKit] 9b3f38: unset std::optional may be dereferenced in current...

Chris Dumez noreply at github.com
Mon Jun 12 10:45:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9b3f38967bcdfcb722cb81f90660e478bbb4eeea
      https://github.com/WebKit/WebKit/commit/9b3f38967bcdfcb722cb81f90660e478bbb4eeea
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    M Source/WebKit/Shared/UserInterfaceIdiom.mm

  Log Message:
  -----------
  unset std::optional may be dereferenced in currentUserInterfaceIdiom()
https://bugs.webkit.org/show_bug.cgi?id=257966
rdar://110626776

Reviewed by Wenson Hsieh.

updateCurrentUserInterfaceIdiom() doesn't set s_currentUserInterfaceIdiom
if s_currentUserInterfaceIdiom was previously unset and the new value is
UserInterfaceIdiom::Default. Therefore, use value_or(UserInterfaceIdiom::Default)
instead of dereferencing s_currentUserInterfaceIdiom unconditionally.

* Source/WebKit/Shared/UserInterfaceIdiom.mm:
(WebKit::currentUserInterfaceIdiom):

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




More information about the webkit-changes mailing list