Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index 85b606e79b3cd6dd46ffde7787e24bde6b4d0450..fe6fb60dce3a188445d75e8461237de8807abe75 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -2065,12 +2065,12 @@ bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start, |
const byte* end, ErrorThrower* thrower, |
ModuleOrigin origin) { |
ModuleResult result = DecodeWasmModule(isolate, start, end, false, origin); |
- if (result.ok()) { |
- DCHECK_NOT_NULL(result.val); |
+ if (result.val) { |
delete result.val; |
- return true; |
+ } else { |
+ DCHECK(!result.ok()); |
} |
- return false; |
+ return result.ok(); |
} |
MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate, |