[wasm][fuzzer] Fix test generation for indirect calls
Indirect calls rely on fixed signature indexes. Thus make test case generation output the signatures exactly like they appear in the module. R=ahaas@chromium.org Change-Id: I80b088024da759ec87695363aeefb28685e1d704 Reviewed-on: https://chromium-review.googlesource.com/c/1350831 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#57837}
This commit is contained in:
parent
e8a1c25f6a
commit
623f20ff6f
@ -193,19 +193,21 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
|
||||
<< glob.mutability << ");\n";
|
||||
}
|
||||
|
||||
for (const FunctionSig* sig : module->signatures) {
|
||||
os << " builder.addType(makeSig(" << PrintParameters(sig) << ", "
|
||||
<< PrintReturns(sig) << "));\n";
|
||||
}
|
||||
|
||||
Zone tmp_zone(isolate->allocator(), ZONE_NAME);
|
||||
|
||||
for (const WasmFunction& func : module->functions) {
|
||||
Vector<const uint8_t> func_code = wire_bytes.GetFunctionBytes(&func);
|
||||
os << " // Generate function " << (func.func_index + 1) << " (out of "
|
||||
<< module->functions.size() << ").\n";
|
||||
// Generate signature.
|
||||
os << " sig" << (func.func_index + 1) << " = makeSig("
|
||||
<< PrintParameters(func.sig) << ", " << PrintReturns(func.sig) << ");\n";
|
||||
|
||||
// Add function.
|
||||
os << " builder.addFunction(undefined, sig" << (func.func_index + 1)
|
||||
<< ")\n";
|
||||
os << " builder.addFunction(undefined, " << func.sig_index
|
||||
<< " /* sig */)\n";
|
||||
|
||||
// Add locals.
|
||||
BodyLocalDecls decls(&tmp_zone);
|
||||
|
Loading…
Reference in New Issue
Block a user