Public repository of the QuickJS Javascript Engine.
Go to file
David Roman 451763ba3b fix: auto-update stack_top on thread/fiber context switch in js_check_stack_overflow
When the runtime is called from a different thread or fiber than the one that captured stack_top, the stack pointer comparison produces false positives. This happens in any M:N threading model (green threads, fibers, coroutines) where each execution context has its own stack at an unrelated address.

Detect this by checking if sp falls outside the expected stack range. If so, call JS_UpdateStackTop() to re-anchor before comparing. Zero overhead on the common single-thread path (unlikely branch). Genuine stack overflows are still detected correctly after re-anchoring.
2026-03-16 21:12:08 -04:00
.github/workflows Run test262 tests in CI 2025-09-29 14:02:31 -04:00
compat Improve js_os_exec (#295) 2024-05-10 01:57:55 +02:00
doc update 2025-10-08 14:16:51 +02:00
examples support JSON modules in qjsc - added support of JSON5 modules (using type = "json5") 2025-05-24 10:24:01 +02:00
fuzz Define lre_check_timeout in fuzz_regexp 2025-04-14 15:56:15 +02:00
tests - optimized Regexp.prototype.exec 2025-11-22 11:00:50 +01:00
.gitignore More CI tragets: Linux 32bit, LTO, Windows and Cosmopolitan 2025-04-22 10:48:01 -04:00
Changelog added regexp duplicate named groups - fixed reset of captures with quantizers 2025-12-03 13:30:33 +01:00
cutils.c faster and safer dbuf functions (#443) 2025-10-13 13:51:25 +02:00
cutils.h faster and safer dbuf functions (#443) 2025-10-13 13:51:25 +02:00
dtoa.c dtoa fix for minus zero 2025-04-21 15:33:47 +02:00
dtoa.h added new dtoa library to print and parse float64 numbers. It is necessary to fix corner cases (e.g. radix != 10) and to have correct behavior regardless of the libc implementation. 2025-03-19 19:07:57 +01:00
libregexp-opcode.h 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
libregexp.c 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
libregexp.h 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
libunicode-table.h updated to unicode 17.0.0 - updated test262 version 2025-11-29 15:14:41 +01:00
libunicode.c faster and safer dbuf functions (#443) 2025-10-13 13:51:25 +02:00
libunicode.h 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
LICENSE Strip trailing spaces 2024-02-10 16:19:17 +01:00
list.h Strip trailing spaces 2024-02-10 16:19:17 +01:00
Makefile updated to unicode 17.0.0 - updated test262 version 2025-11-29 15:14:41 +01:00
qjs.c qjs: added --strict option - don't consider included files as modules - allow module and strict code with -e option 2025-11-03 17:22:18 +01:00
qjsc.c qjsc: handle C name conflicts between scripts and modules (#432) 2025-08-27 16:07:05 +02:00
quickjs-atom.h - Added Iterator.concat (initial patch by bnoordhuis) 2025-11-15 12:22:50 +01:00
quickjs-libc.c fixed Worker freeing logic (#462) 2025-11-22 11:03:45 +01:00
quickjs-libc.h support JSON modules in qjsc - added support of JSON5 modules (using type = "json5") 2025-05-24 10:24:01 +02:00
quickjs-opcode.h slightly faster lexical variable assignment 2025-12-22 15:03:43 +01:00
quickjs.c fix: auto-update stack_top on thread/fiber context switch in js_check_stack_overflow 2026-03-16 21:12:08 -04:00
quickjs.h fixed regression in error message display introduced in commit 42eb279 2025-10-12 13:23:50 +02:00
readme-cosmo.txt new release 2025-04-26 12:30:26 +02:00
readme.txt 2020-01-05 release 2020-09-06 18:53:08 +02:00
release.sh updated release.sh 2025-09-18 10:28:33 +02:00
repl.js added JS_PrintValue() and use it in console.log(), print() and the REPL (#256) 2025-04-30 13:40:15 +02:00
run-test262.c run-test262: added --count_skipped_features option 2025-08-27 15:19:45 +02:00
test262_errors.txt added regexp duplicate named groups - fixed reset of captures with quantizers 2025-12-03 13:30:33 +01:00
test262.conf Don't call well-known Symbol methods for RegExp on primitive values 2025-12-11 19:27:19 +01:00
test262o_errors.txt 2020-01-05 release 2020-09-06 18:53:08 +02:00
test262o.conf Fix test262o error 2024-02-10 20:54:29 +01:00
TODO Don't call well-known Symbol methods for RegExp on primitive values 2025-12-11 19:27:19 +01:00
unicode_download.sh updated to unicode 17.0.0 - updated test262 version 2025-11-29 15:14:41 +01:00
unicode_gen_def.h updated to unicode 17.0.0 - updated test262 version 2025-11-29 15:14:41 +01:00
unicode_gen.c added missing 'Unknown' unicode Script 2025-05-24 15:36:08 +02:00
VERSION new release 2025-09-13 10:51:18 +02:00

The main documentation is in doc/quickjs.pdf or doc/quickjs.html.