OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "test/fuzzer/wasm-section-fuzzers.h" |
| 6 |
| 7 using namespace v8::internal; |
| 8 |
| 9 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| 10 bool run_all = !(FLAG_wasm_fuzz_types || FLAG_wasm_fuzz_names || |
| 11 FLAG_wasm_fuzz_globals || FLAG_wasm_fuzz_imports || |
| 12 FLAG_wasm_fuzz_function_sigs || FLAG_wasm_fuzz_memory || |
| 13 FLAG_wasm_fuzz_data); |
| 14 |
| 15 if (run_all || FLAG_wasm_fuzz_types) { |
| 16 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::Signatures, data, |
| 17 size); |
| 18 } |
| 19 if (run_all || FLAG_wasm_fuzz_names) { |
| 20 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::Names, data, size); |
| 21 } |
| 22 if (run_all || FLAG_wasm_fuzz_globals) { |
| 23 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::Globals, data, |
| 24 size); |
| 25 } |
| 26 if (run_all || FLAG_wasm_fuzz_imports) { |
| 27 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::ImportTable, data, |
| 28 size); |
| 29 } |
| 30 if (run_all || FLAG_wasm_fuzz_function_sigs) { |
| 31 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::FunctionSignatures, |
| 32 data, size); |
| 33 } |
| 34 if (run_all || FLAG_wasm_fuzz_memory) { |
| 35 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::Memory, data, |
| 36 size); |
| 37 } |
| 38 if (run_all || FLAG_wasm_fuzz_data) { |
| 39 fuzz_wasm_section(v8::internal::wasm::WasmSection::Code::DataSegments, data, |
| 40 size); |
| 41 } |
| 42 |
| 43 return 0; |
| 44 } |
OLD | NEW |