diff options
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 2e432b174..07f0a634b 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -494,7 +494,7 @@ void FunctionValidator::visitGetGlobal(GetGlobal* curr) { void FunctionValidator::visitSetGlobal(SetGlobal* curr) { if (!info.validateGlobally) return; auto* global = getModule()->getGlobalOrNull(curr->name); - if (shouldBeTrue(global, curr, "set_global name must be valid (and not an import; imports can't be modified)")) { + if (shouldBeTrue(global != NULL, curr, "set_global name must be valid (and not an import; imports can't be modified)")) { shouldBeTrue(global->mutable_, curr, "set_global global must be mutable"); shouldBeEqualOrFirstIsUnreachable(curr->value->type, global->type, curr, "set_global value must have right type"); } @@ -1031,10 +1031,10 @@ static void validateModule(Module& module, ValidationInfo& info) { // perhaps by moving some of the pass infrastructure into libsupport. bool WasmValidator::validate(Module& module, FeatureSet features, Flags flags) { ValidationInfo info; - info.validateWeb = flags & Web; - info.validateGlobally = flags & Globally; + info.validateWeb = (flags & Web) != 0; + info.validateGlobally = (flags & Globally) != 0; info.features = features; - info.quiet = flags & Quiet; + info.quiet = (flags & Quiet) != 0; // parallel wasm logic validation PassRunner runner(&module); runner.add<FunctionValidator>(&info); |