summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-05-27 07:52:56 -0700
committerGitHub <noreply@github.com>2020-05-27 07:52:56 -0700
commit31a8d2f19df620427a81f787ebaff7412964e538 (patch)
tree6b084b5ee4eb89f920606d96b5bb8d4906cf5829
parent799df43f39f69fa79c5dc2b5c8b3a3af9be11d9d (diff)
downloadbinaryen-31a8d2f19df620427a81f787ebaff7412964e538.tar.gz
binaryen-31a8d2f19df620427a81f787ebaff7412964e538.tar.bz2
binaryen-31a8d2f19df620427a81f787ebaff7412964e538.zip
Fuzz asyncify fuzzer: when no exported memory, skip (#2874)
We need the memory to be exported in order to read and write stuff for the asyncify data structure.
-rw-r--r--scripts/fuzz_shell.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js
index dbe17098d..5a652a096 100644
--- a/scripts/fuzz_shell.js
+++ b/scripts/fuzz_shell.js
@@ -56,9 +56,10 @@ var Asyncify = {
(function(module, i) {
ret[module][i] = function() {
if (!Asyncify.sleeping) {
- // Sleep if asyncify support is present, and at a certain
- // probability.
- if (exports.asyncify_start_unwind &&
+ // Sleep if asyncify support is present (which also requires
+ // that the memory be exported), and at a certain probability.
+ if (exports.asyncify_start_unwind &&
+ view &&
detrand() < 0.5) {
// We are called in order to start a sleep/unwind.
console.log('asyncify: sleep in ' + i + '...');