From 0e068c386ef1588c09e57a4d081be626d83bc31c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 30 Nov 2018 09:54:57 -0800 Subject: Fuzzing: log values during execution (#1779) Before we just looked at function return values when looking for differences before and after running some passes, while fuzzing. This adds logging of values during execution, which can represent control flow, monitor locals, etc., giving a lot more opportunities for the fuzzer to find problems. Also: * Clean up the sigToFunctionType function, which allocated a struct and returned it. This makes it safer by returning the struct by value, which is also easier to use in this PR. * Fix printing of imported function calls without a function type - turns out we always generate function types in loading, so we didn't notice this was broken, but this new fuzzer feature hit it. --- src/wasm/wasm-s-parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 42dd9df0d..de1e4f2e9 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -570,7 +570,7 @@ void SExpressionWasmBuilder::parseFunction(Element& s, bool preParseImport) { // see https://github.com/WebAssembly/spec/pull/301 if (type.isNull()) { // if no function type name provided, then we generated one - std::unique_ptr functionType = std::unique_ptr(sigToFunctionType(getSigFromStructs(result, params))); + auto functionType = make_unique(sigToFunctionType(getSigFromStructs(result, params))); for (auto& existing : wasm.functionTypes) { if (existing->structuralComparison(*functionType)) { type = existing->name; -- cgit v1.2.3