diff options
author | Alon Zakai <azakai@google.com> | 2019-05-02 13:09:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 13:09:18 -0700 |
commit | b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf (patch) | |
tree | 0610ee3fea56d492adef79345bae271e8be3b334 /src/wasm/wasm-s-parser.cpp | |
parent | 01a4bfdb5c28d54fd480d603cba2d35c943a0bf5 (diff) | |
download | binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.tar.gz binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.tar.bz2 binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.zip |
Optimize mutable globals (#2066)
If a global is marked mutable but not assigned to, make it immutable.
If an immutable global is a copy of another, use the original, so we can remove the duplicates.
Fixes #2011
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index cd9eb690a..a869aa08a 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1813,10 +1813,6 @@ void SExpressionWasmBuilder::parseExport(Element& s) { ex->kind = ExternalKind::Table; } else if (inner[0]->str() == GLOBAL) { ex->kind = ExternalKind::Global; - if (wasm.getGlobalOrNull(ex->value) && - wasm.getGlobal(ex->value)->mutable_) { - throw ParseException("cannot export a mutable global", s.line, s.col); - } } else { throw ParseException("invalid export"); } |