Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: src/wasm/module-decoder.cc

Issue 2481263003: [wasm] Mutable globals cannot be exported (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698