1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 02:27:35 +00:00

Lagom: Add fuzz testing for LibJS using libFuzzer (#1692)

Note: clang only (see https://llvm.org/docs/LibFuzzer.html)

- add FuzzJs which will run the LibJS parser on random javascript inputs
- added a basic dictionary of javascript tokens

To use fuzzer:
CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DENABLE_FUZZER_SANITIZER=1 ..
Fuzzers/FuzzJs -dict=../Fuzzers/FuzzJs.dict
This commit is contained in:
Paul Redmond 2020-04-08 04:40:02 -04:00 committed by GitHub
parent e91cb83a23
commit 7291d5c86f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 140 additions and 0 deletions

View file

@ -0,0 +1,9 @@
add_executable(FuzzJs FuzzJs.cpp)
target_compile_options(FuzzJs
PRIVATE $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
)
target_link_libraries(FuzzJs
PUBLIC lagom
PRIVATE $<$<C_COMPILER_ID:Clang>:-fsanitize=fuzzer>
)