You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime: Map/WeakMap.prototype.set reflective on invalid receiver crashes (SIGBUS) instead of TypeError (#3662) #4099
Part of the #3662 cluster (collection prototype brand checks, originally PR #3739).
Map.prototype.set / WeakMap.prototype.set invoked reflectively on an invalid
receiver crashes the process (EXC_BAD_ACCESS, exit 138) instead of throwing
the spec TypeError. The sibling methods (Map.prototype.get, Set.prototype.add,
etc.) correctly throw — only .set crashes.
Repro
(Map.prototype.setasany).call(null,1,2);// SIGBUS — should throw TypeError
map_proto_set_thunk itself looks correct (it calls map_receiver_or_throw
before js_map_set); the fault is in the reflective .call dispatch reaching
it / the BUILTIN_MAP_SET_VALUE_BITS "remembered set value" path. An lldb
backtrace shows a type-confusion deref (EXC_BAD_ACCESS code=2) in a
NaN-box-tag check, before the brand check runs.
Severity
High — a crash, and it masks the rest of the collection brand-check test.
I am taking this with #4100 and #4102 in one runtime reflective-builtins PR cut. Planned scope: fix reflective collection set receiver validation, primitive wrapper prototype brand/value dispatch, and dynamic instanceof / constructor @@hasInstance recognition for Array/Object/Date without taking the separate function-source or typed-array-view work.
Activity
andrewtdiz commentedon Jun 2, 2026
I am taking this with #4100 and #4102 in one runtime reflective-builtins PR cut. Planned scope: fix reflective collection set receiver validation, primitive wrapper prototype brand/value dispatch, and dynamic instanceof / constructor @@hasInstance recognition for Array/Object/Date without taking the separate function-source or typed-array-view work.
fix(runtime): keep small-handle floor in boxed-primitive probe (#4099)
fix(runtime): stop size-accessor install corrupting Map/Set.prototype…
fix(runtime): cap field_count to inline capacity in ensure_key_in_key…