| Index: src/runtime/runtime-compiler.cc | 
| diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc | 
| index 9fe5d9c1ef7cacb80c58b1072edb1eec23068829..0ed8b080b3d787f904baa2314a389e61400a9668 100644 | 
| --- a/src/runtime/runtime-compiler.cc | 
| +++ b/src/runtime/runtime-compiler.cc | 
| @@ -93,7 +93,9 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) { | 
| if (args[3]->IsJSArrayBuffer()) { | 
| memory = args.at<i::JSArrayBuffer>(3); | 
| } | 
| -  if (args[1]->IsJSObject() && function->shared()->HasAsmWasmData()) { | 
| +  if (args[1]->IsJSObject() && function->shared()->HasAsmWasmData() && | 
| +      AsmJs::IsStdlibValid(isolate, handle(function->shared()->asm_wasm_data()), | 
| +                           args.at<JSReceiver>(1))) { | 
| MaybeHandle<Object> result; | 
| result = AsmJs::InstantiateAsmWasm( | 
| isolate, handle(function->shared()->asm_wasm_data()), memory, foreign); | 
|  |