Skip to content

Claude/quickjs upstream rebase ynm6eo#1

Merged
andrewmd5 merged 55 commits into
masterfrom
claude/quickjs-upstream-rebase-ynm6eo
Jun 20, 2026
Merged

Claude/quickjs upstream rebase ynm6eo#1
andrewmd5 merged 55 commits into
masterfrom
claude/quickjs-upstream-rebase-ynm6eo

Conversation

@andrewmd5

Copy link
Copy Markdown

No description provided.

Fabrice Bellard and others added 30 commits March 21, 2026 10:55
…zed. It is slightly slower but avoids several nasty bugs (bellard#471)
…he comparison function. Fixed buffer overflow when the array is resized (bellard#477)
Some newer compilers emit this warning:

```
warning: initializer-string for character array is too long, array size is 36
     but initializer has size 37 (including the null terminating character);
     did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization]
 12146 | static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

To avoid the warning initialize the array as individual characters
In other engines, 0x0.toString() returns '0', but QJS would try to parse it
as a float and then throw.
Also removes remnants of hex float parsing which is no longer supported
anyway.

(Port of quickjs-ng/quickjs#377)
…ning

Avoid initializer-string warning for the digits array
Fix member access on non-decimal numeric literals
…unction name as quickjs-ng for js_atomics_get_buf() (bellard#508)
The flag is needed to pass the two CanBlockIsFalse tests from test262
when running individual preprocessed tests via run-test262 -N.
Fabrice Bellard and others added 25 commits June 2, 2026 10:43
… in case the allocation of the new array buffer fails. Also avoid setting opaque = NULL for the custom array buffer free function
…huis) - fixed unsafe thread termination in show_progress() - use the number of physical cores by default - added -T option to force the number of threads - avoid hardcoding the maximum number of threads
…#512)

* Add fuzz targets for ES6 modules, JSON, RegExp, and bytecode

Adds 4 new fuzzers targeting high-complexity, low-coverage functions:

- fuzz_module_export: Tests ES6 module export/import parsing (complexity 6727)

- fuzz_json: Tests JSON stringify/parse (complexity ~5000)

- fuzz_regexp_compile: Tests RegExp compilation (complexity 5528)

- fuzz_bytecode: Tests bytecode execution (complexity 5383)

Identified by Fuzz Introspector as having 0% runtime coverage.

Build integration for fuzz/Makefile and build.sh included.

* Convert fuzz targets from C++ to C and use standard C headers
Port of quickjs-ng/quickjs#1409 (bnoordhuis).
I modified it to prevent an atom leak in js_parse_statement_or_decl,
otherwise it's the same.
…y base64/hex

Merge the latest upstream master (53 commits since the last sync, VERSION
2025-09-13 -> 2026-06-04).

Conflict resolutions:
- Makefile: kept the custom WASI/Hako build; upstream's standard-build
  changes (sanitizers, test targets, test262 bootstrap) do not apply.
- quickjs.c: took upstream's standard __EMSCRIPTEN__ macro over the fork's
  non-standard EMSCRIPTEN spelling (behaviour is identical for the WASI build).
- quickjs-libc.c: added upstream's <poll.h> include for poll() support;
  placed outside the !__wasi__ guard since wasi-libc provides poll.h and the
  JSThreadState.poll_fds field is compiled for WASI.

Uint8Array base64/hex:
Replaced the fork's home-grown implementation with upstream's
(commit e182e3d, "Add Uint8Array base64/hex methods"). The fork had
registered toBase64/toHex/fromBase64/fromHex/setFromBase64/setFromHex on the
generic %TypedArray%; upstream correctly exposes them on Uint8Array only.
Removed the fork's js_typed_array_*Base64/Hex functions and their entries in
js_typed_array_base_funcs / js_typed_array_base_proto_funcs, keeping upstream's
js_uint8array_* implementation and Uint8Array-specific registration.

Verified: quickjs.c and quickjs-libc.c compile cleanly natively, and a C-API
test confirms toBase64/fromBase64/toHex/fromHex/setFromHex round-trip and that
the methods are absent from generic typed arrays (Int8Array/Float64Array).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMggTo4MS7PTA69XhKJ1TY
The fork changed the JSInterruptHandler typedef in quickjs.h to take a
JSContext *ctx, but the stock interrupt_handler in quickjs-libc.c still used
the 2-arg signature, producing an incompatible-pointer-type warning at the
JS_SetInterruptHandler call. Add the ctx parameter to match the typedef.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMggTo4MS7PTA69XhKJ1TY
@andrewmd5 andrewmd5 merged commit eae5836 into master Jun 20, 2026
0 of 20 checks passed
@andrewmd5 andrewmd5 deleted the claude/quickjs-upstream-rebase-ynm6eo branch June 20, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants