Fix building fuzzer
BUG=tint:53
Change-Id: I0462baf302d5183b089dbdfd595045f8376f7a53
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20145
Reviewed-by: David Neto <dneto@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c4db92..8778d57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,7 +152,7 @@
add_subdirectory(samples)
if (${TINT_BUILD_FUZZERS})
- if (NOT ${TINT_BUILD_WGSL_READER)
+ if (NOT ${TINT_BUILD_WGSL_READER})
message(ERROR, "Fuzzers require WGSL reader to be enabled")
endif()
diff --git a/fuzz/tint_fuzz.cc b/fuzz/tint_fuzz.cc
index f6d3657..bd6d067 100644
--- a/fuzz/tint_fuzz.cc
+++ b/fuzz/tint_fuzz.cc
@@ -19,7 +19,8 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
std::string str(reinterpret_cast<const char*>(data), size);
- tint::reader::wgsl::Parser parser(str);
+ tint::Context ctx;
+ tint::reader::wgsl::Parser parser(&ctx, str);
parser.Parse();
return 0;