quickjs/fuzz
Molefi1146 ba414937c7 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.
2026-05-03 22:02:54 +02:00
..
fuzz_common.c more bignum cleanup 2025-03-19 11:43:31 +01:00
fuzz_common.h OSS-Fuzz targets improvements (#267) 2024-05-08 18:19:48 +02:00
fuzz_compile.c OSS-Fuzz targets improvements (#267) 2024-05-08 18:19:48 +02:00
fuzz_eval.c OSS-Fuzz targets improvements (#267) 2024-05-08 18:19:48 +02:00
fuzz_module_export.cc Add fuzz targets for ES6 modules, JSON, RegExp, and bytecode 2026-05-03 22:02:54 +02:00
fuzz_regexp.c Define lre_check_timeout in fuzz_regexp 2025-04-14 15:56:15 +02:00
fuzz.dict more bignum cleanup 2025-03-19 11:43:31 +01:00
generate_dict.js OSS-Fuzz targets improvements (#267) 2024-05-08 18:19:48 +02:00
README OSS-Fuzz targets improvements (#267) 2024-05-08 18:19:48 +02:00

libFuzzer support for QuickJS
=============================

Build QuickJS with libFuzzer support as follows:

  CONFIG_CLANG=y make libfuzzer

This can be extended with sanitizer support to improve efficacy:

  CONFIG_CLANG=y CONFIG_ASAN=y make libfuzzer


Currently, there are three fuzzing targets defined: fuzz_eval, fuzz_compile and fuzz_regexp.
The above build command will produce an executable binary for each of them, which can be
simply executed as:

  ./fuzz_eval

or with an initial corpus:

  ./fuzz_compile corpus_dir/

or with a predefined dictionary to improve its efficacy:

  ./fuzz_eval -dict fuzz/fuzz.dict

or with arbitrary CLI arguments provided by libFuzzer (https://llvm.org/docs/LibFuzzer.html).