summaryrefslogtreecommitdiff
path: root/src/passes/Bysyncify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Bysyncify.cpp')
-rw-r--r--src/passes/Bysyncify.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Bysyncify.cpp b/src/passes/Bysyncify.cpp
index e798be562..f1e6c9f7d 100644
--- a/src/passes/Bysyncify.cpp
+++ b/src/passes/Bysyncify.cpp
@@ -202,6 +202,7 @@
#include "ir/effects.h"
#include "ir/literal-utils.h"
+#include "ir/memory-utils.h"
#include "ir/module-utils.h"
#include "ir/utils.h"
#include "pass.h"
@@ -948,6 +949,10 @@ private:
struct Bysyncify : public Pass {
void run(PassRunner* runner, Module* module) override {
bool optimize = runner->options.optimizeLevel > 0;
+
+ // Ensure there is a memory, as we need it.
+ MemoryUtils::ensureExists(module->memory);
+
// Find which things can change the state.
auto stateChangingImports =
runner->options.getArgumentOrDefault("bysyncify-imports", "");