Update remaining fuzzers to use TransforBuilder
Missed some fuzzers in my last fix, because I was trying to git grep between repos... This should fix any outstanding issues with NULL being passed into SetTransformManager in TintCommonFuzzer. BUG=chromium:1255313 Change-Id: Idf71bc34bb75041accec303df3da0bc6f9cd15cc Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65940 Auto-Submit: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
ceab140a8b
commit
71763c84c2
|
@ -20,6 +20,7 @@
|
|||
#include "fuzzers/tint_ast_fuzzer/mutator.h"
|
||||
#include "fuzzers/tint_ast_fuzzer/override_cli_params.h"
|
||||
#include "fuzzers/tint_common_fuzzer.h"
|
||||
#include "fuzzers/transform_builder.h"
|
||||
|
||||
#include "src/reader/wgsl/parser.h"
|
||||
#include "src/writer/wgsl/generator.h"
|
||||
|
@ -109,13 +110,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
continue;
|
||||
}
|
||||
|
||||
transform::Manager transform_manager;
|
||||
transform::DataMap transform_inputs;
|
||||
transform_manager.Add<transform::Robustness>();
|
||||
TransformBuilder tb(data, size);
|
||||
tb.AddTransform<tint::transform::Robustness>();
|
||||
|
||||
CommonFuzzer fuzzer(InputFormat::kWGSL, target.output_format);
|
||||
fuzzer.EnableInspector();
|
||||
fuzzer.SetTransformManager(&transform_manager, &transform_inputs);
|
||||
fuzzer.SetTransformManager(tb.manager(), tb.data_map());
|
||||
|
||||
fuzzer.Run(data, size);
|
||||
if (fuzzer.HasErrors()) {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "fuzzers/tint_regex_fuzzer/cli.h"
|
||||
#include "fuzzers/tint_regex_fuzzer/override_cli_params.h"
|
||||
#include "fuzzers/tint_regex_fuzzer/wgsl_mutator.h"
|
||||
#include "fuzzers/transform_builder.h"
|
||||
#include "src/reader/wgsl/parser.h"
|
||||
#include "src/writer/wgsl/generator.h"
|
||||
|
||||
|
@ -137,13 +138,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
continue;
|
||||
}
|
||||
|
||||
transform::Manager transform_manager;
|
||||
transform::DataMap transform_inputs;
|
||||
transform_manager.Add<transform::Robustness>();
|
||||
TransformBuilder tb(data, size);
|
||||
tb.AddTransform<tint::transform::Robustness>();
|
||||
|
||||
CommonFuzzer fuzzer(InputFormat::kWGSL, target.output_format);
|
||||
fuzzer.EnableInspector();
|
||||
fuzzer.SetTransformManager(&transform_manager, &transform_inputs);
|
||||
fuzzer.SetTransformManager(tb.manager(), tb.data_map());
|
||||
|
||||
fuzzer.Run(data, size);
|
||||
}
|
||||
|
|
|
@ -14,16 +14,17 @@
|
|||
|
||||
#include "fuzzers/fuzzer_init.h"
|
||||
#include "fuzzers/tint_common_fuzzer.h"
|
||||
#include "fuzzers/transform_builder.h"
|
||||
|
||||
namespace tint {
|
||||
namespace fuzzers {
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
tint::transform::Manager transform_manager;
|
||||
transform_manager.Add<tint::transform::Robustness>();
|
||||
TransformBuilder tb(data, size);
|
||||
tb.AddTransform<tint::transform::Robustness>();
|
||||
|
||||
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
|
||||
fuzzer.SetTransformManager(&transform_manager, {});
|
||||
fuzzer.SetTransformManager(tb.manager(), tb.data_map());
|
||||
fuzzer.SetDumpInput(GetCliParams().dump_input);
|
||||
|
||||
return fuzzer.Run(data, size);
|
||||
|
|
Loading…
Reference in New Issue