[webkit-changes] [WebKit/WebKit] b21650: Node refcounting should prevent ref()'s that escap...

geoffreygaren noreply at github.com
Sun Dec 1 22:53:08 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b21650be30cd366e48323bd1c5de1e42e6481dd4
      https://github.com/WebKit/WebKit/commit/b21650be30cd366e48323bd1c5de1e42e6481dd4
  Author: Geoffrey Garen <ggaren at apple.com>
  Date:   2024-12-01 (Sun, 01 Dec 2024)

  Changed paths:
    M Source/WebCore/dom/Node.cpp

  Log Message:
  -----------
  Node refcounting should prevent ref()'s that escape the destructor
https://bugs.webkit.org/show_bug.cgi?id=283852
rdar://140730076

Reviewed by Ryosuke Niwa.

A ref that escapes the destructor is a use after free. This patch adds a
RELEASE_ASSERT to ensure the safety model at runtime.

Hilariously, the existing code was accidentally performing the debug mode
check in release builds. So this patch just standardizes the check with how
RefCounted does it, making the check more efficient in release builds.

* Source/WebCore/dom/Node.cpp:
(WebCore::Node::~Node):

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