diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/GlobalRefining.cpp | 5 | ||||
-rw-r--r-- | src/wasm/wasm-validator.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/passes/GlobalRefining.cpp b/src/passes/GlobalRefining.cpp index 129f34283..1313421d5 100644 --- a/src/passes/GlobalRefining.cpp +++ b/src/passes/GlobalRefining.cpp @@ -143,8 +143,9 @@ struct GlobalRefining : public Pass { ReFinalize().walkFunctionInModule(curr, &wasm); } } - }; - GetUpdater(*this, *module).run(getPassRunner(), module); + } updater(*this, *module); + updater.run(getPassRunner(), module); + updater.runOnModuleCode(getPassRunner(), module); } }; diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 74e9b6e79..e8a4033ef 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1004,9 +1004,11 @@ void FunctionValidator::visitGlobalGet(GlobalGet* curr) { if (!info.validateGlobally) { return; } - shouldBeTrue(getModule()->getGlobalOrNull(curr->name), - curr, - "global.get name must be valid"); + auto* global = getModule()->getGlobalOrNull(curr->name); + if (shouldBeTrue(global, curr, "global.get name must be valid")) { + shouldBeEqual( + curr->type, global->type, curr, "global.get must have right type"); + } } void FunctionValidator::visitGlobalSet(GlobalSet* curr) { |