]> git.kaiwu.me - quickjs.git/commit
regexp: ensure that the bytecode size grows linearly with respect to
authorFabrice Bellard <fabrice@bellard.org>
Sat, 29 Nov 2025 11:39:52 +0000 (12:39 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 29 Nov 2025 11:39:52 +0000 (12:39 +0100)
commit371c06e35964a8211b30d94511eb29b8bffe1360
treee896e4a55896e654fc49c222a529dd3253fe6560
parenta77400796df93195e431216efa6e5344f40d08fe
regexp: ensure that the bytecode size grows linearly with respect to
the input regexp.

This way, pathological regexps such as
/(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(?:a|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+/ are no longer an issue. The generated bytecode is also simpler and
faster.
libregexp-opcode.h
libregexp.c