OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test/fuzzer/wasm-section-fuzzers.h" | 5 #include "test/fuzzer/wasm-section-fuzzers.h" |
6 | 6 |
7 #include "include/v8.h" | 7 #include "include/v8.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 #include "src/wasm/encoder.h" | 9 #include "src/wasm/encoder.h" |
10 #include "src/wasm/wasm-module.h" | 10 #include "src/wasm/wasm-module.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 const char* name = WasmSection::getName(section); | 40 const char* name = WasmSection::getName(section); |
41 size_t length = WasmSection::getNameLength(section); | 41 size_t length = WasmSection::getNameLength(section); |
42 buffer.write_size(length); // Section name string size. | 42 buffer.write_size(length); // Section name string size. |
43 buffer.write(reinterpret_cast<const uint8_t*>(name), length); | 43 buffer.write(reinterpret_cast<const uint8_t*>(name), length); |
44 buffer.write_u32v(static_cast<uint32_t>(size)); | 44 buffer.write_u32v(static_cast<uint32_t>(size)); |
45 buffer.write(data, size); | 45 buffer.write(data, size); |
46 | 46 |
47 ErrorThrower thrower(i_isolate, "decoder"); | 47 ErrorThrower thrower(i_isolate, "decoder"); |
48 | 48 |
49 std::unique_ptr<const WasmModule> module(testing::DecodeWasmModuleForTesting( | 49 std::unique_ptr<const WasmModule> module(testing::DecodeWasmModuleForTesting( |
50 i_isolate, &zone, thrower, buffer.begin(), buffer.end(), kWasmOrigin)); | 50 i_isolate, &zone, &thrower, buffer.begin(), buffer.end(), kWasmOrigin)); |
51 | 51 |
52 return 0; | 52 return 0; |
53 } | 53 } |
OLD | NEW |