Skip to content

Commit

Permalink
try fixing fuzzer build
Browse files Browse the repository at this point in the history
  • Loading branch information
rol1510 committed Jan 10, 2024
1 parent 9dd4710 commit 1da5ad6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion fuzz/fuzz-configuration-json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdint>
#include <quick-lint-js/configuration/configuration.h>
#include <quick-lint-js/container/padded-string.h>
#include <quick-lint-js/diag/diag-list.h>
#include <quick-lint-js/diag/diag-reporter.h>
#include <quick-lint-js/port/char8.h>

Expand All @@ -14,7 +15,9 @@ int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {

Padded_String json(String8(reinterpret_cast<const Char8 *>(data), size));
Configuration c;
c.load_from_json(&json, &Null_Diag_Reporter::instance);
Monotonic_Allocator temp_memory("fuzz");
Diag_List diags(&temp_memory);
c.load_from_json(&json, &diags);

return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions fuzz/fuzz-parse-lint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ extern "C" {
int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
quick_lint_js::Padded_String source(quick_lint_js::String8(
reinterpret_cast<const quick_lint_js::Char8 *>(data), size));
quick_lint_js::Global_Declared_Variable_Set globals;
quick_lint_js::parse_and_lint(&source,
quick_lint_js::Null_Diag_Reporter::instance,
globals, quick_lint_js::Linter_Options());
quick_lint_js::Linter_Options());
return 0;
}
}
Expand Down

0 comments on commit 1da5ad6

Please sign in to comment.