From be3135ca8db88ed7445dc2dd12ea78f55d963c7d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 1 Jul 2019 17:45:53 -0700 Subject: Bysyncify: Fuzzing (#2192) Gets fuzzing support for Bysyncify working. * Add the python to run the fuzzing on bysyncify. * Add a JS script to load and run a testcase with bysyncify support. The code has all the runtime support for sleep/resume etc., which it does on calls to imports at random in a deterministic manner. * Export memory from fuzzer so JS can access it. * Fix tiny builder bug with makeExport. --- src/tools/fuzzing.h | 2 ++ src/wasm-builder.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 0a7128e3e..80945eb9e 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -375,6 +375,8 @@ private: hasher->type = ensureFunctionType(getSig(hasher), &wasm)->name; wasm.addExport( builder.makeExport(hasher->name, hasher->name, ExternalKind::Function)); + // Export memory so JS fuzzing can use it + wasm.addExport(builder.makeExport("memory", "0", ExternalKind::Memory)); } void setupTable() { diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 284608105..7d839357e 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -84,7 +84,7 @@ public: auto* export_ = new Export(); export_->name = name; export_->value = value; - export_->kind = ExternalKind::Function; + export_->kind = kind; return export_; } -- cgit v1.2.3