Commit eeb99d31 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][fuzzer] Remove unused return value

R=ahaas@chromium.org

Bug: v8:8238
Change-Id: I7a7de894aa7bf074cbe732f40e16b10060fa37dd
Reviewed-on: https://chromium-review.googlesource.com/c/1344149
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57660}
parent 81a654e7
...@@ -46,7 +46,8 @@ class WasmCodeFuzzer : public WasmExecutionFuzzer { ...@@ -46,7 +46,8 @@ class WasmCodeFuzzer : public WasmExecutionFuzzer {
}; };
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return WasmCodeFuzzer().FuzzWasmModule({data, size}); WasmCodeFuzzer().FuzzWasmModule({data, size});
return 0;
} }
} // namespace fuzzer } // namespace fuzzer
......
...@@ -849,7 +849,8 @@ class WasmCompileFuzzer : public WasmExecutionFuzzer { ...@@ -849,7 +849,8 @@ class WasmCompileFuzzer : public WasmExecutionFuzzer {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
constexpr bool require_valid = true; constexpr bool require_valid = true;
return WasmCompileFuzzer().FuzzWasmModule({data, size}, require_valid); WasmCompileFuzzer().FuzzWasmModule({data, size}, require_valid);
return 0;
} }
} // namespace fuzzer } // namespace fuzzer
......
...@@ -249,12 +249,12 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes, ...@@ -249,12 +249,12 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
os << "})();\n"; os << "})();\n";
} }
int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, void WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
bool require_valid) { bool require_valid) {
// Strictly enforce the input size limit. Note that setting "max_len" on the // Strictly enforce the input size limit. Note that setting "max_len" on the
// fuzzer target is not enough, since different fuzzers are used and not all // fuzzer target is not enough, since different fuzzers are used and not all
// respect that limit. // respect that limit.
if (data.size() > max_input_size()) return 0; if (data.size() > max_input_size()) return;
v8_fuzzer::FuzzerSupport* support = v8_fuzzer::FuzzerSupport::Get(); v8_fuzzer::FuzzerSupport* support = v8_fuzzer::FuzzerSupport::Get();
v8::Isolate* isolate = support->GetIsolate(); v8::Isolate* isolate = support->GetIsolate();
...@@ -282,7 +282,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -282,7 +282,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
if (!data.is_empty()) data += 1; if (!data.is_empty()) data += 1;
if (!GenerateModule(i_isolate, &zone, data, buffer, num_args, if (!GenerateModule(i_isolate, &zone, data, buffer, num_args,
interpreter_args, compiler_args)) { interpreter_args, compiler_args)) {
return 0; return;
} }
testing::SetupIsolateForWasmModule(i_isolate); testing::SetupIsolateForWasmModule(i_isolate);
...@@ -314,7 +314,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -314,7 +314,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
CHECK_EQ(compiles, validates); CHECK_EQ(compiles, validates);
CHECK_IMPLIES(require_valid, validates); CHECK_IMPLIES(require_valid, validates);
if (!compiles) return 0; if (!compiles) return;
MaybeHandle<WasmInstanceObject> interpreter_instance = MaybeHandle<WasmInstanceObject> interpreter_instance =
i_isolate->wasm_engine()->SyncInstantiate( i_isolate->wasm_engine()->SyncInstantiate(
...@@ -322,7 +322,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -322,7 +322,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
MaybeHandle<JSReceiver>(), MaybeHandle<JSArrayBuffer>()); MaybeHandle<JSReceiver>(), MaybeHandle<JSArrayBuffer>());
// Ignore instantiation failure. // Ignore instantiation failure.
if (interpreter_thrower.error()) return 0; if (interpreter_thrower.error()) return;
testing::WasmInterpretationResult interpreter_result = testing::WasmInterpretationResult interpreter_result =
testing::InterpretWasmModule(i_isolate, testing::InterpretWasmModule(i_isolate,
...@@ -331,7 +331,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -331,7 +331,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
// Do not execute the generated code if the interpreter did not finished after // Do not execute the generated code if the interpreter did not finished after
// a bounded number of steps. // a bounded number of steps.
if (interpreter_result.stopped()) return 0; if (interpreter_result.stopped()) return;
// The WebAssembly spec allows the sign bit of NaN to be non-deterministic. // The WebAssembly spec allows the sign bit of NaN to be non-deterministic.
// This sign bit can make the difference between an infinite loop and // This sign bit can make the difference between an infinite loop and
...@@ -339,7 +339,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -339,7 +339,7 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
// the generated code will not go into an infinite loop and cause a timeout in // the generated code will not go into an infinite loop and cause a timeout in
// Clusterfuzz. Therefore we do not execute the generated code if the result // Clusterfuzz. Therefore we do not execute the generated code if the result
// may be non-deterministic. // may be non-deterministic.
if (interpreter_result.possible_nondeterminism()) return 0; if (interpreter_result.possible_nondeterminism()) return;
int32_t result_compiled; int32_t result_compiled;
{ {
...@@ -368,7 +368,6 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -368,7 +368,6 @@ int WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
// Cleanup any pending exception. // Cleanup any pending exception.
i_isolate->clear_pending_exception(); i_isolate->clear_pending_exception();
return 0;
} }
} // namespace fuzzer } // namespace fuzzer
......
...@@ -32,7 +32,7 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes, ...@@ -32,7 +32,7 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
class WasmExecutionFuzzer { class WasmExecutionFuzzer {
public: public:
virtual ~WasmExecutionFuzzer() = default; virtual ~WasmExecutionFuzzer() = default;
int FuzzWasmModule(Vector<const uint8_t> data, bool require_valid = false); void FuzzWasmModule(Vector<const uint8_t> data, bool require_valid = false);
virtual size_t max_input_size() const { return 512; } virtual size_t max_input_size() const { return 512; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment