Skip to content

Commit f06c3ec

Browse files
committed
Update QuickJS: Unicode 17 and regex memory blowup fix
* Unicode 17.0 bellard/quickjs@b226856 * Regexp: ensure that the bytecode size grows linearly with respect to the input regexp bellard/quickjs@371c06e
1 parent 563d1ec commit f06c3ec

8 files changed

Lines changed: 2454 additions & 2330 deletions

File tree

src/couch_quickjs/patches/01-spidermonkey-185-mode.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- quickjs-master/quickjs.c 2025-11-22 06:10:55.000000000 -0500
2-
+++ quickjs/quickjs.c 2025-11-22 12:45:37.890107480 -0500
1+
--- quickjs-master/quickjs.c 2025-11-29 09:14:41.000000000 -0500
2+
+++ quickjs/quickjs.c 2025-11-29 20:38:38.829402534 -0500
33
@@ -31420,10 +31420,24 @@
44
if (s->token.val == TOK_FUNCTION ||
55
(token_is_pseudo_keyword(s, JS_ATOM_async) &&

src/couch_quickjs/patches/02-test262-errors.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
--- quickjs-master/test262_errors.txt 2025-11-22 06:10:55.000000000 -0500
2-
+++ quickjs/test262_errors.txt 2025-11-22 12:45:37.894107458 -0500
3-
@@ -19,6 +19,8 @@
4-
test262/test/language/expressions/compound-assignment/S11.13.2_A6.10_T1.js:24: Test262Error: #1: innerX === 2. Actual: 5
5-
test262/test/language/expressions/compound-assignment/S11.13.2_A6.11_T1.js:24: Test262Error: #1: innerX === 2. Actual: 5
6-
test262/test/language/identifier-resolution/assign-to-global-undefined.js:20: strict mode: expected error
1+
--- quickjs-master/test262_errors.txt 2025-11-29 09:14:41.000000000 -0500
2+
+++ quickjs/test262_errors.txt 2025-11-29 20:38:38.835402578 -0500
3+
@@ -23,6 +23,8 @@
4+
test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js:74: SyntaxError: export 'foo' in module 'test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js' is ambiguous
5+
test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js:75: SyntaxError: export 'foo' in module 'test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js' is ambiguous
6+
test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js:74: SyntaxError: export 'foo' in module 'test262/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js' is ambiguous
77
+test262/test/language/statements/expression/S12.4_A1.js:15: unexpected error type: Test262: This statement should not be evaluated.
88
+test262/test/language/statements/expression/S12.4_A1.js:15: strict mode: unexpected error type: Test262: This statement should not be evaluated.
99
test262/test/staging/sm/Function/arguments-parameter-shadowing.js:14: Test262Error: Expected SameValue(«true», «false») to be true

src/couch_quickjs/quickjs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ PREFIX?=/usr/local
5555
#CONFIG_UBSAN=y
5656

5757
# TEST262 bootstrap config: commit id and shallow "since" parameter
58-
TEST262_COMMIT?=42303c7c2bcf1c1edb9e5375c291c6fbc8a261ab
58+
TEST262_COMMIT?=d0994d64b07cb6c164dd9f345c94ed797a53d69f
5959
TEST262_SINCE?=2025-09-01
6060

6161
OBJDIR=.obj

src/couch_quickjs/quickjs/libregexp-opcode.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ DEF(save_start, 2) /* save start position */
4545
DEF(save_end, 2) /* save end position, must come after saved_start */
4646
DEF(save_reset, 3) /* reset save positions */
4747
DEF(loop, 6) /* decrement the top the stack and goto if != 0 */
48-
DEF(push_i32, 6) /* push integer on the stack */
48+
DEF(loop_split_goto_first, 10) /* loop and then split */
49+
DEF(loop_split_next_first, 10)
50+
DEF(loop_check_adv_split_goto_first, 10) /* loop and then check advance and split */
51+
DEF(loop_check_adv_split_next_first, 10)
52+
DEF(set_i32, 6) /* store the immediate value to a register */
4953
DEF(word_boundary, 1)
5054
DEF(word_boundary_i, 1)
5155
DEF(not_word_boundary, 1)
@@ -60,8 +64,8 @@ DEF(range32, 3) /* variable length */
6064
DEF(range32_i, 3) /* variable length */
6165
DEF(lookahead, 5)
6266
DEF(negative_lookahead, 5) /* must come after */
63-
DEF(push_char_pos, 2) /* push the character position on the stack */
64-
DEF(check_advance, 2) /* pop one stack element and check that it is different from the character position */
67+
DEF(set_char_pos, 2) /* store the character position to a register */
68+
DEF(check_advance, 2) /* check that the register is different from the character position */
6569
DEF(prev, 1) /* go to the previous char */
6670

6771
#endif /* DEF */

0 commit comments

Comments
 (0)