summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/test/shared.py1
-rw-r--r--src/wasm/wasm-binary.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index 665ad6b7c..76d6fd568 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -400,7 +400,6 @@ os.chdir(options.out_dir)
# expected-output/ if any.
SPEC_TESTS_TO_SKIP = [
# Malformed module accepted
- 'globals.wast',
'binary-leb128.wast',
'utf8-custom-section-id.wast',
'utf8-import-field.wast',
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 01b3602eb..cd1ca7dfd 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -2591,6 +2591,9 @@ void WasmBinaryReader::readImports() {
Name name(std::string("gimport$") + std::to_string(globalCounter++));
auto type = getConcreteType();
auto mutable_ = getU32LEB();
+ if (mutable_ & ~1) {
+ throwError("Global mutability must be 0 or 1");
+ }
auto curr =
builder.makeGlobal(name,
type,