diff --git a/BUILD.gn b/BUILD.gn index 53fc2a6560..1e04c69710 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -787,11 +787,8 @@ group("dawn_fuzzers") { testonly = true deps = [ "src/fuzzers:dawn_spirv_cross_glsl_fast_fuzzer", - "src/fuzzers:dawn_spirv_cross_glsl_full_fuzzer", "src/fuzzers:dawn_spirv_cross_hlsl_fast_fuzzer", - "src/fuzzers:dawn_spirv_cross_hlsl_full_fuzzer", "src/fuzzers:dawn_spirv_cross_msl_fast_fuzzer", - "src/fuzzers:dawn_spirv_cross_msl_full_fuzzer", "src/fuzzers:dawn_wire_server_and_frontend_fuzzer", ] } diff --git a/src/fuzzers/BUILD.gn b/src/fuzzers/BUILD.gn index 2b151dcc74..2369f94d1c 100644 --- a/src/fuzzers/BUILD.gn +++ b/src/fuzzers/BUILD.gn @@ -92,19 +92,6 @@ dawn_fuzzer_test("dawn_spirv_cross_glsl_fast_fuzzer") { asan_options = [ "allow_user_segv_handler=1" ] } -# TODO(rharrison): Remove asan_options once signal trap is no longer -# needed. -# Varies both the options and input data -dawn_fuzzer_test("dawn_spirv_cross_glsl_full_fuzzer") { - sources = [ - "DawnSPIRVCrossGLSLFullFuzzer.cpp", - ] - deps = [ - ":dawn_spirv_cross_fuzzer_common", - ] - asan_options = [ "allow_user_segv_handler=1" ] -} - # TODO(rharrison): Remove asan_options once signal trap is no longer # needed. # Uses Dawn specific options and varies input data @@ -118,19 +105,6 @@ dawn_fuzzer_test("dawn_spirv_cross_hlsl_fast_fuzzer") { asan_options = [ "allow_user_segv_handler=1" ] } -# TODO(rharrison): Remove asan_options once signal trap is no longer -# needed. -# Varies both the options and input data -dawn_fuzzer_test("dawn_spirv_cross_hlsl_full_fuzzer") { - sources = [ - "DawnSPIRVCrossHLSLFullFuzzer.cpp", - ] - deps = [ - ":dawn_spirv_cross_fuzzer_common", - ] - asan_options = [ "allow_user_segv_handler=1" ] -} - # TODO(rharrison): Remove asan_options once signal trap is no longer # needed. # Uses Dawn specific options and varies input data @@ -144,19 +118,6 @@ dawn_fuzzer_test("dawn_spirv_cross_msl_fast_fuzzer") { asan_options = [ "allow_user_segv_handler=1" ] } -# TODO(rharrison): Remove asan_options once signal trap is no longer -# needed. -# Varies both the options and input data -dawn_fuzzer_test("dawn_spirv_cross_msl_full_fuzzer") { - sources = [ - "DawnSPIRVCrossMSLFullFuzzer.cpp", - ] - deps = [ - ":dawn_spirv_cross_fuzzer_common", - ] - asan_options = [ "allow_user_segv_handler=1" ] -} - dawn_fuzzer_test("dawn_wire_server_and_frontend_fuzzer") { sources = [ "DawnWireServerAndFrontendFuzzer.cpp", diff --git a/src/fuzzers/DawnSPIRVCrossFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossFuzzer.cpp index f080adbc6f..6dbaf0659d 100644 --- a/src/fuzzers/DawnSPIRVCrossFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossFuzzer.cpp @@ -76,15 +76,4 @@ namespace DawnSPIRVCrossFuzzer { return 0; } - int RunWithOptions(const uint8_t* data, size_t size, TaskWithOptions task) { - shaderc_spvc::CompileOptions options; - size_t used = options.SetForFuzzing(data, size); - if (used == 0) { - // not enough data to set options - return 0; - } - - return Run(data + used, size - used, std::bind(task, std::placeholders::_1, options)); - } - } // namespace DawnSPIRVCrossFuzzer diff --git a/src/fuzzers/DawnSPIRVCrossFuzzer.h b/src/fuzzers/DawnSPIRVCrossFuzzer.h index 2f017e3b7b..b60fd5d77f 100644 --- a/src/fuzzers/DawnSPIRVCrossFuzzer.h +++ b/src/fuzzers/DawnSPIRVCrossFuzzer.h @@ -30,8 +30,4 @@ namespace DawnSPIRVCrossFuzzer { // Used to fuzz by mutating the input data, but with fixed options to the compiler int Run(const uint8_t* data, size_t size, Task task); - - // Used to fuzz by mutating both the input data and options to the compiler - int RunWithOptions(const uint8_t* data, size_t size, TaskWithOptions task); - } // namespace DawnSPIRVCrossFuzzer diff --git a/src/fuzzers/DawnSPIRVCrossGLSLFullFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossGLSLFullFuzzer.cpp deleted file mode 100644 index b592517b95..0000000000 --- a/src/fuzzers/DawnSPIRVCrossGLSLFullFuzzer.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "DawnSPIRVCrossFuzzer.h" - -namespace { - - int GLSLFullFuzzTask(const std::vector& input, shaderc_spvc::CompileOptions options) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { - return 0; - } - - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() { - compiler.CompileSpvToGlsl(input.data(), input.size(), options); - }); - - return 0; - } - -} // namespace - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, GLSLFullFuzzTask); -} diff --git a/src/fuzzers/DawnSPIRVCrossHLSLFullFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossHLSLFullFuzzer.cpp deleted file mode 100644 index c0601730a1..0000000000 --- a/src/fuzzers/DawnSPIRVCrossHLSLFullFuzzer.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "DawnSPIRVCrossFuzzer.h" - -namespace { - int FuzzTask(const std::vector& input, shaderc_spvc::CompileOptions options) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { - return 0; - } - - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() { - compiler.CompileSpvToHlsl(input.data(), input.size(), options); - }); - - return 0; - } - -} // namespace - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, FuzzTask); -} diff --git a/src/fuzzers/DawnSPIRVCrossMSLFullFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossMSLFullFuzzer.cpp deleted file mode 100644 index 0549f25523..0000000000 --- a/src/fuzzers/DawnSPIRVCrossMSLFullFuzzer.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 The Dawn Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "DawnSPIRVCrossFuzzer.h" - -namespace { - - int FuzzTask(const std::vector& input, shaderc_spvc::CompileOptions options) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { - return 0; - } - - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input, &options]() { - compiler.CompileSpvToMsl(input.data(), input.size(), options); - }); - - return 0; - } - -} // namespace - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - return DawnSPIRVCrossFuzzer::RunWithOptions(data, size, FuzzTask); -}