Commit Graph

307 Commits

Author SHA1 Message Date
Nick Vatamaniuc
d38eea9336
Avoid initializer-string warning for the digits array
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
2026-03-24 00:53:29 -04:00
Fabrice Bellard
d7ae12ae71 added JSON.parse source text access
Some checks failed
ci / Linux (Ubuntu) (push) Has been cancelled
ci / Linux LTO (push) Has been cancelled
ci / Linux 32bit (push) Has been cancelled
ci / linux-asan (push) Has been cancelled
ci / linux-msan (push) Has been cancelled
ci / linux-ubsan (push) Has been cancelled
ci / macOS (push) Has been cancelled
ci / macos-asan (push) Has been cancelled
ci / macos-ubsan (push) Has been cancelled
ci / freebsd (push) Has been cancelled
ci / Cosmopolitan (push) Has been cancelled
ci / MinGW Windows target (push) Has been cancelled
ci / Windows MSYS2 (push) Has been cancelled
ci / qemu-alpine (linux/386) (push) Has been cancelled
ci / qemu-alpine (linux/arm/v6) (push) Has been cancelled
ci / qemu-alpine (linux/arm/v7) (push) Has been cancelled
ci / qemu-alpine (linux/arm64) (push) Has been cancelled
ci / qemu-alpine (linux/ppc64le) (push) Has been cancelled
ci / qemu-alpine (linux/riscv64) (push) Has been cancelled
ci / qemu-alpine (linux/s390x) (push) Has been cancelled
2026-03-23 18:45:52 +01:00
Fabrice Bellard
a31dcef98c added basic protection against too large function in serialized bytecode
Some checks failed
ci / Linux (Ubuntu) (push) Has been cancelled
ci / Linux LTO (push) Has been cancelled
ci / Linux 32bit (push) Has been cancelled
ci / linux-asan (push) Has been cancelled
ci / linux-msan (push) Has been cancelled
ci / linux-ubsan (push) Has been cancelled
ci / macOS (push) Has been cancelled
ci / macos-asan (push) Has been cancelled
ci / macos-ubsan (push) Has been cancelled
ci / freebsd (push) Has been cancelled
ci / Cosmopolitan (push) Has been cancelled
ci / MinGW Windows target (push) Has been cancelled
ci / Windows MSYS2 (push) Has been cancelled
ci / qemu-alpine (linux/386) (push) Has been cancelled
ci / qemu-alpine (linux/arm/v6) (push) Has been cancelled
ci / qemu-alpine (linux/arm/v7) (push) Has been cancelled
ci / qemu-alpine (linux/arm64) (push) Has been cancelled
ci / qemu-alpine (linux/ppc64le) (push) Has been cancelled
ci / qemu-alpine (linux/riscv64) (push) Has been cancelled
ci / qemu-alpine (linux/s390x) (push) Has been cancelled
2026-03-21 17:49:40 +01:00
Fabrice Bellard
5022f2b76a fixed use-after-free via re-entrant GC in FinalizationRegistry weak reference cleanup (#494) 2026-03-21 17:39:27 +01:00
Fabrice Bellard
e7b9f217b4 Fix async generator lifecycle bug (bnoordhuis) (quickjs-ng/quickjs#1355)
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / Linux LTO (push) Waiting to run
ci / Linux 32bit (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / Cosmopolitan (push) Waiting to run
ci / MinGW Windows target (push) Waiting to run
ci / Windows MSYS2 (push) Waiting to run
ci / qemu-alpine (linux/386) (push) Waiting to run
ci / qemu-alpine (linux/arm/v6) (push) Waiting to run
ci / qemu-alpine (linux/arm/v7) (push) Waiting to run
ci / qemu-alpine (linux/arm64) (push) Waiting to run
ci / qemu-alpine (linux/ppc64le) (push) Waiting to run
ci / qemu-alpine (linux/riscv64) (push) Waiting to run
ci / qemu-alpine (linux/s390x) (push) Waiting to run
2026-03-21 16:34:37 +01:00
Fabrice Bellard
4d16546cdf fixed RegExp.escape 2026-03-21 15:53:25 +01:00
Fabrice Bellard
46bd985b33 fixed buffer overflow in Atomics with resizable typed arrays 2026-03-21 15:35:03 +01:00
Fabrice Bellard
16d6947b17 typo 2026-03-21 14:31:19 +01:00
Fabrice Bellard
f1b63fc1ad Fix memory leak in Iterator.prototype.map (saghul) (#493) 2026-03-21 14:26:00 +01:00
Fabrice Bellard
841dd034c2 fixed buffer overflow in TypedArray.prototype.with (#492) 2026-03-21 14:18:38 +01:00
Fabrice Bellard
69090b969f Fix stack underflow with generator in iterable (saghul) (#488) 2026-03-21 13:43:57 +01:00
Fabrice Bellard
68caa5f226 fixed TypedArray constructor semantics which removes a buffer overflow (#478) 2026-03-21 12:23:53 +01:00
Fabrice Bellard
0989d4cb4a fixed TypedArray sort semantics by copying the array before calling the comparison function. Fixed buffer overflow when the array is resized (#477) 2026-03-21 11:33:13 +01:00
Fabrice Bellard
4c722cea4e modified js_allocate_fast_array() so that the array is fully initialized. It is slightly slower but avoids several nasty bugs (#471) 2026-03-21 10:55:57 +01:00
Fabrice Bellard
f1139494d1 regexp: removed alloca() is lre_exec() - added specific opcodes for \s and \S to have a smaller bytecode - optimized \b and \B 2025-12-22 15:12:46 +01:00
Fabrice Bellard
31ef02b907 slightly faster lexical variable assignment 2025-12-22 15:03:43 +01:00
Fabrice Bellard
c73a435f36 Don't call well-known Symbol methods for RegExp on primitive values 2025-12-11 19:27:19 +01:00
Fabrice Bellard
1dbba8a88e removed use after free in js_create_module_bytecode_function() (#467) 2025-12-11 19:18:56 +01:00
Fabrice Bellard
fcd33c1afa removed memory leak in case of error in cpool_add() (#468) 2025-12-11 19:17:38 +01:00
Fabrice Bellard
e5fd3918c1 fixed fast array extension optimization when there are multiple realms 2025-12-03 13:36:26 +01:00
Fabrice Bellard
24379bf53c added regexp duplicate named groups - fixed reset of captures with quantizers 2025-12-03 13:30:33 +01:00
Fabrice Bellard
a77400796d removed buffer overflows introduced in regexp optimizations 2025-11-22 12:10:55 +01:00
Fabrice Bellard
9f11034a5a - optimized Regexp.prototype.exec
- optimized String.prototype.replace
- optimized 'arguments' object creation
- optimized access to non strict 'arguments' elements
2025-11-22 11:00:50 +01:00
Fabrice Bellard
fcbf5ea2a6 fixed BJSON array serialization (#457) 2025-11-15 14:52:50 +01:00
Fabrice Bellard
4bd485d713 - Added Iterator.concat (initial patch by bnoordhuis)
- optimized js_iterator_concat_next()
- added more guards against recursion in Iterator.concat operations
2025-11-15 12:22:50 +01:00
Fabrice Bellard
3d0cc291d4 optimized add/sub int32 overflow 2025-11-15 12:18:18 +01:00
Fabrice Bellard
125b01279c added error checking in JS_InstantiateFunctionListItem() 2025-11-15 12:10:44 +01:00
Fabrice Bellard
ae7219b1a1 - Closure optimization (go from quadratic to linear time when the number
of closure variables is large)
- Separated JSVarDef and JSBytecodeVarDef to simplify the code and save memory
- fixed debug info stripping with global variables
2025-11-15 12:01:20 +01:00
Fabrice Bellard
9688007ccb Restore a mistakenly removed goto on error in js_build_module_ns() (igorburago) 2025-11-05 11:46:20 +01:00
Fabrice Bellard
b07ad11c31 fixed JS_PROP_AUTOINIT handling in js_closure_define_global_var() (#455) 2025-11-05 11:41:18 +01:00
Fabrice Bellard
d10613f8f9 fixed exception handling in put_var operation (regression introduced by commit a6816be) (#454) 2025-11-05 11:29:03 +01:00
Fabrice Bellard
080c01f346 More informative "not a constructor" error message (initial patch by bnoordhuis) (#368) 2025-11-03 18:53:32 +01:00
Fabrice Bellard
c6fe5a98fd Fix length check in ArrayBuffer.prototype.slice (bnoordhuis) (#451) 2025-11-03 18:38:20 +01:00
Fabrice Bellard
7cfddd0664 fixed DataView resizing 2025-11-03 18:29:10 +01:00
Fabrice Bellard
75b5230000 Fix use-after-free in ArrayBuffer.prototype.transfer (bnoordhuis) (#450) - use js_array_buffer_update_typed_arrays() in JS_DetachArrayBuffer() 2025-11-03 18:23:19 +01:00
Fabrice Bellard
e015918dd8 Much faster destructuring at the expense of a slight incompatibility
with the spec when direct evals are present (v8 behaves the same way).
2025-11-03 17:08:59 +01:00
Fabrice Bellard
a6816be23a optimized global variable access 2025-11-03 16:57:20 +01:00
Fabrice Bellard
eb2c89087d removed uninitialized variable 2025-10-18 12:04:12 +02:00
Fabrice Bellard
c31809e84d fixed operation order in Regexp constructor 2025-10-18 11:05:05 +02:00
Fabrice Bellard
af16a97921 changed module rejection order according to spec change 2025-10-18 10:50:51 +02:00
Fabrice Bellard
9a421b3338 optimized Array.prototype.push 2025-10-16 15:21:24 +02:00
Fabrice Bellard
3e5f2bbe69 inlined the get_length operation 2025-10-16 15:10:58 +02:00
Fabrice Bellard
c720e35d26 added js_string_eq() 2025-10-16 15:00:29 +02:00
Fabrice Bellard
2161640067 stricter year parsing in Date 2025-10-13 14:51:37 +02:00
Fabrice Bellard
7fb994c45d fixed argument evaluation order in Date constructor and Date.UTC() 2025-10-13 14:11:47 +02:00
Fabrice Bellard
0d4cd2d051 faster and safer dbuf functions (#443) 2025-10-13 13:51:25 +02:00
Fabrice Bellard
63450099a3 fixed regression in error message display introduced in commit 42eb279 2025-10-12 13:23:50 +02:00
Fabrice Bellard
eb9fa2b8da compilation fix for clang 2025-10-11 11:13:13 +02:00
Fabrice Bellard
42eb2795f0 Faster context creation and exception checks in JS_NewContext (#404)
- simplified internal object init
- check exceptions in JS_NewContext()
- preallocated std object properties
- preallocated more atoms
2025-10-11 10:59:21 +02:00
Fabrice Bellard
c8a8cf57c6 faster appending of elements in arrays 2025-10-08 14:11:27 +02:00