Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3f22094cdc45a72a7a7e0b9e10149470628b1ac0
      
https://github.com/WebKit/WebKit/commit/3f22094cdc45a72a7a7e0b9e10149470628b1ac0
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-03-27 (Fri, 27 Mar 2026)

  Changed paths:
    A JSTests/stress/describe-null-butterfly.js
    M Source/JavaScriptCore/runtime/JSCJSValue.cpp

  Log Message:
  -----------
  [JSC] Fix null butterfly dereference in 
JSValue::dumpInContextAssumingStructure
https://bugs.webkit.org/show_bug.cgi?id=310783

Reviewed by Yusuke Suzuki.

JSValue::dumpInContextAssumingStructure unconditionally calls
butterfly()->base(structure) without checking if butterfly() returns
null. Objects with only inline properties (no indexed storage, no
out-of-line properties) have a null butterfly pointer. When the DFG
graph dump or describe() prints such objects, this triggers undefined
behavior caught by UBSAN:

    Butterfly.h:182:21: runtime error: member call on null pointer of
    type 'JSC::Butterfly *'

The call chain does only pointer arithmetic so it does not crash in
practice, but the output "(base=0xfffffffffffffff8)" is meaningless
and the member call on a null pointer is still UB.

Fix by checking if butterfly is null before computing the base address.

* JSTests/stress/describe-null-butterfly.js: Added.
* Source/JavaScriptCore/runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContextAssumingStructure const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to