Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 38402aef767e211ec4d7e2a8e46bfc8e969ad6be..062fe5b131792266c2f7c57b3a2f58757e4656a1 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -475,7 +475,12 @@ class ModuleDecoder : public Decoder { |
case kExternalGlobal: { |
WasmGlobal* global = nullptr; |
exp->index = consume_global_index(module, &global); |
- if (global) global->exported = true; |
+ if (global) { |
+ if (global->mutability) { |
+ error("mutable globals cannot be exported"); |
+ } |
+ global->exported = true; |
+ } |
break; |
} |
default: |