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
fix(fetch+runtime): generic object ops must not deref fetch-band Headers/Request handles (#5606)
* fix(fetch): route Headers value stringify through a registry-aware helper
The fetch thunk serialized init.headers via the generic js_json_stringify,
which dereferenced a Headers handle (a fetch-band registry id) as a heap
pointer -> EXC_BAD_ACCESS in gc_obj_type. Add js_fetch_headers_to_json that
reads a Headers handle from its registry instead, and route the
fetch(url, { headers }) path through it. Same handle-band family as the
string_from_header / inline-.length guards.
(Advances the bundle's -p path past the json-stringify crash; a further
handle-band deref remains in js_object_has_property on a Headers handle.)
* fix(runtime): js_object_has_property must reject handle-band receivers
`key in <handle>` where the receiver is a Web Fetch Headers/Request/Response
handle (a fetch-band registry id, e.g. 0x40007) dereferenced the id as a heap
object -> EXC_BAD_ACCESS. Return false for handle-band receivers instead, same
family as the string_from_header / inline-.length / json_stringify guards.
* address CodeRabbit review + file-size lint (#5606)
- js_object_has_property: narrow the handle-band crash guard to the fetch/zlib
bands (>= COMMON_HANDLE_BAND_END). Common/small handles now fall through to
the registered small-handle property path instead of always returning false.
- headers_init_json_ptr: normalize null/undefined headers to {} in the shared
helper so the codegen js_fetch_headers_to_json path matches the runtime thunk
(previously serialized headers:null as "null").
- Move the headers_fetch_object_json test out of fetch/mod.rs into a sibling
headers_json_test.rs submodule so fetch/mod.rs is back under the 2000-LOC
CI limit (2020 -> 1992).
---------
Co-authored-by: Ralph Küpper <ralph2@skelpo.com>
0 commit comments