[webkit-changes] [WebKit/WebKit] ff2909: WebCore::XPath::Parser::Token contains uninitializ...

Commit Queue noreply at github.com
Wed May 29 21:24:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ff290911a4c8c24e3863c1b6f38d3da07b3fcf5b
      https://github.com/WebKit/WebKit/commit/ff290911a4c8c24e3863c1b6f38d3da07b3fcf5b
  Author: David Kilzer <ddkilzer at apple.com>
  Date:   2024-05-29 (Wed, 29 May 2024)

  Changed paths:
    M Source/WebCore/xml/XPathParser.cpp

  Log Message:
  -----------
  WebCore::XPath::Parser::Token contains uninitialized fields after construction
<https://bugs.webkit.org/show_bug.cgi?id=274872>
<rdar://128972339>

Reviewed by Chris Dumez.

Merge individual token values into a std::variant<> type named
TokenValue to make sure their initialized state and value are tracked
properly.

* Source/WebCore/xml/XPathParser.cpp:
(WebCore::XPath::Parser::Token::TokenValue): Add.
- Declare std::variant type to hold one of four possible values.
(WebCore::XPath::Parser::Token::Token):
- Replace four instance variables with TokenValue variable.
- Delete default constructor since it is unused.
- Condense constructors taking different value arguments into a single
  constructor taking a TokenValue (std::variant) r-value.
(WebCore::XPath::Parser::Token::string): Add.
(WebCore::XPath::Parser::Token::axis): Add.
(WebCore::XPath::Parser::Token::numericOpcode): Add.
(WebCore::XPath::Parser::Token::equalityTestOpcode): Add.
- Add getter methods to read `value` instance variable.
(WebCore::XPath::Parser::lex):
- Update to use getter methods.

Canonical link: https://commits.webkit.org/279493@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