Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index a65b357bbb558fa5d12b46937f7d60c7e67a9fde..0dd53d22c826673279d3c6ebc4cb64bfcbfaa05b 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -1813,6 +1813,19 @@ MaybeHandle<JSObject> CreateModuleObjectFromBytes(Isolate* isolate, |
origin); |
} |
+bool ValidateModuleBytes(Isolate* isolate, const byte* start, const byte* end, |
+ ErrorThrower* thrower, ModuleOrigin origin) { |
+ Zone zone(isolate->allocator()); |
+ ModuleResult result = |
+ DecodeWasmModule(isolate, &zone, start, end, false, origin); |
+ if (result.ok()) { |
+ DCHECK_NOT_NULL(result.val); |
+ delete result.val; |
+ return true; |
+ } |
+ return false; |
+} |
+ |
MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, |
Handle<JSObject> instance) { |
Object* mem = instance->GetInternalField(kWasmMemArrayBuffer); |