From ba0a6541885d324b9562a79a8977ed8733191b7f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 19 Sep 2016 17:18:59 -0700 Subject: globals mutability fixes --- src/wasm-s-parser.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/wasm-s-parser.h') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index b4fcd3466..6280de7d3 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1517,8 +1517,7 @@ private: ex->kind = Export::Table; } else if (inner[0]->str() == GLOBAL) { ex->kind = Export::Global; - auto* global = wasm.getGlobal(ex->value); - if (global->mutable_) throw ParseException("cannot export a mutable global", s.line, s.col); + if (wasm.checkGlobal(ex->value) && wasm.getGlobal(ex->value)->mutable_) throw ParseException("cannot export a mutable global", s.line, s.col); } else { WASM_UNREACHABLE(); } -- cgit v1.2.3