summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-07-01 17:45:53 -0700
committerGitHub <noreply@github.com>2019-07-01 17:45:53 -0700
commitbe3135ca8db88ed7445dc2dd12ea78f55d963c7d (patch)
treeda93646517a457876c2803ae237d8c6906685a9b /src
parentab34a779552ea4a8747e7729433d8c7f89c458c0 (diff)
downloadbinaryen-be3135ca8db88ed7445dc2dd12ea78f55d963c7d.tar.gz
binaryen-be3135ca8db88ed7445dc2dd12ea78f55d963c7d.tar.bz2
binaryen-be3135ca8db88ed7445dc2dd12ea78f55d963c7d.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/fuzzing.h2
-rw-r--r--src/wasm-builder.h2
2 files changed, 3 insertions, 1 deletions
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_;
}