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>
This commit is contained in:
Ryan Harrison 2020-04-22 00:25:10 +00:00 committed by dan sinclair
parent c9308dcb75
commit 3170bebba1
2 changed files with 3 additions and 2 deletions

View File

@ -152,7 +152,7 @@ add_subdirectory(src)
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()

View File

@ -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;