mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-06 22:53:35 +00:00
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:
parent
c9308dcb75
commit
3170bebba1
@ -152,7 +152,7 @@ add_subdirectory(src)
|
|||||||
add_subdirectory(samples)
|
add_subdirectory(samples)
|
||||||
|
|
||||||
if (${TINT_BUILD_FUZZERS})
|
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")
|
message(ERROR, "Fuzzers require WGSL reader to be enabled")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@
|
|||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
std::string str(reinterpret_cast<const char*>(data), 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();
|
parser.Parse();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user