[webkit-changes] [WebKit/WebKit] c4467f: WebCore::XPath::Value has uninitialized fields aft...

Commit Queue noreply at github.com
Thu May 30 02:57:57 PDT 2024


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

  Changed paths:
    M Source/WebCore/xml/XPathFunctions.cpp
    M Source/WebCore/xml/XPathPath.h
    M Source/WebCore/xml/XPathPredicate.cpp
    M Source/WebCore/xml/XPathPredicate.h
    M Source/WebCore/xml/XPathResult.cpp
    M Source/WebCore/xml/XPathValue.cpp
    M Source/WebCore/xml/XPathValue.h
    M Source/WebCore/xml/XPathVariableReference.h

  Log Message:
  -----------
  WebCore::XPath::Value has uninitialized fields after construction
<https://bugs.webkit.org/show_bug.cgi?id=274864>
<rdar://128966823>

Reviewed by Chris Dumez.

Fix in XPathValue.h is to set m_bool and m_double to default values when
constructing WebCore::XPath::Value objects.

Additional drive-by fixes that comprise most of the changes:
- Update WebCore::XPath::Value::Type to an enum class.
- Fix format of header files to remove unwanted whitespace.
- Add missing comments for closing namespace braces.
- Fix indentation of case statements in XPathValue.cpp.
- Fix formatting of constructors in XPathValue.h.

* Source/WebCore/xml/XPathFunctions.cpp:
* Source/WebCore/xml/XPathPath.h:
* Source/WebCore/xml/XPathPredicate.cpp:
(WebCore::XPath::predicateIsContextPositionSensitive):
* Source/WebCore/xml/XPathPredicate.h:
* Source/WebCore/xml/XPathResult.cpp:
(WebCore::XPathResult::XPathResult):
* Source/WebCore/xml/XPathValue.cpp:
(WebCore::XPath::Value::modifiableNodeSet):
(WebCore::XPath::Value::toBoolean const):
(WebCore::XPath::Value::toNumber const):
(WebCore::XPath::Value::toString const):
* Source/WebCore/xml/XPathValue.h:
(WebCore::XPath::Value):
- Initialize m_bool to false and m_double to 0 to fix the bug.
(WebCore::XPath::Value::Type):
- Change to enum class with size uint8_t.
- Remove redundant "Value" from the end of enum names.
(WebCore::XPath::Value::Value):
- Delete default constructor since it is unused.
(WebCore::XPath::Value::type const):
(WebCore::XPath::Value::isNodeSet const):
(WebCore::XPath::Value::isBoolean const):
(WebCore::XPath::Value::isNumber const):
(WebCore::XPath::Value::isString const):
(WebCore::XPath::Value::Data::create):
(WebCore::XPath::Value::Data::Data):
* Source/WebCore/xml/XPathVariableReference.h:

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