Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/fuzzer/wasm-fuzzer-common.cc')
-rw-r--r--deps/v8/test/fuzzer/wasm-fuzzer-common.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/deps/v8/test/fuzzer/wasm-fuzzer-common.cc b/deps/v8/test/fuzzer/wasm-fuzzer-common.cc
index 590bc1bc173..1c8bafcea2c 100644
--- a/deps/v8/test/fuzzer/wasm-fuzzer-common.cc
+++ b/deps/v8/test/fuzzer/wasm-fuzzer-common.cc
@@ -172,7 +172,14 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
<< glob.mutability << ");\n";
}
- for (const FunctionSig* sig : module->signatures) {
+ // TODO(7748): Support array/struct types.
+#if DEBUG
+ for (uint8_t kind : module->type_kinds) {
+ DCHECK_EQ(kWasmFunctionTypeCode, kind);
+ }
+#endif
+ for (TypeDefinition type : module->types) {
+ const FunctionSig* sig = type.function_sig;
os << "builder.addType(makeSig(" << PrintParameters(sig) << ", "
<< PrintReturns(sig) << "));\n";
}
@@ -191,6 +198,7 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
}
for (const WasmElemSegment& elem_segment : module->elem_segments) {
os << "builder.addElementSegment(";
+ os << elem_segment.table_index << ", ";
switch (elem_segment.offset.kind) {
case WasmInitExpr::kGlobalIndex:
os << elem_segment.offset.val.global_index << ", true";
@@ -251,7 +259,6 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
os << "assertThrows(function() { builder.instantiate(); }, "
"WebAssembly.CompileError);\n";
}
- os << "\n";
}
void WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,