ladybird/Meta/Lagom/Fuzzers/add-serenity-support-to-fuzzilli.patch
Luke 1c18d1380f Lagom/Fuzzers: Fix FuzzilliJs build and update patch for new Fuzzilli version
-fsanitize=fuzzer was being added to LINKER_FLAGS from Lagom/CMakeLists,
which we don't want with FuzzilliJs as we want to define the functions
it provides ourselves.
2021-01-24 00:40:49 +01:00

47 lines
1.2 KiB
Diff

diff --git a/Sources/FuzzilliCli/Profiles/Profile.swift b/Sources/FuzzilliCli/Profiles/Profile.swift
index 900b4e2..c916e84 100644
--- a/Sources/FuzzilliCli/Profiles/Profile.swift
+++ b/Sources/FuzzilliCli/Profiles/Profile.swift
@@ -33,6 +33,35 @@ struct Profile {
let additionalBuiltins: [String: Type]
}
+let serenityProfile = Profile(
+ processArguments: [""],
+
+ processEnv: ["UBSAN_OPTIONS":"handle_segv=0 handle_abrt=0"],
+
+ codePrefix: """
+ function main() {
+ """,
+
+ codeSuffix: """
+ }
+ main();
+ """,
+
+ ecmaVersion: ECMAScriptVersion.es6,
+
+ crashTests: ["fuzzilli('FUZZILLI_CRASH', 0)", "fuzzilli('FUZZILLI_CRASH', 1)"],
+
+ additionalCodeGenerators: WeightedList<CodeGenerator>([]),
+
+ additionalProgramTemplates: WeightedList<ProgramTemplate>([]),
+
+ disabledCodeGenerators: [],
+
+ additionalBuiltins: [
+ "gc" : .function([] => .undefined)
+ ]
+)
+
let profiles = [
"qjs": qjsProfile,
"jsc": jscProfile,
@@ -40,4 +69,5 @@ let profiles = [
"v8": v8Profile,
"duktape": duktapeProfile,
"jerryscript": jerryscriptProfile,
+ "serenity": serenityProfile,
]