[WASM] Fix CompileJsToWasmWrappers during shutdown 32/297732/3
authorJakub Gajownik <j.gajownik2@samsung.com>
Fri, 18 Aug 2023 14:21:08 +0000 (16:21 +0200)
committerj.gajownik2 <j.gajownik2@samsung.com>
Wed, 23 Aug 2023 09:09:37 +0000 (11:09 +0200)
Bug: https://cam.sprc.samsung.pl/browse/VDGAME-334
Change-Id: I9a3899ac5279928f94f59029622535680c34a54d
Signed-off-by: Jakub Gajownik <j.gajownik2@samsung.com>
v8/src/wasm/module-compiler.cc

index 31e3842e26e523477971bf61fe5e04ef2672de9c..07663f650074c9ec552505498b934760780fd032 100644 (file)
@@ -3885,6 +3885,12 @@ void CompileJsToWasmWrappers(Isolate* isolate, const WasmModule* module,
   if (FLAG_wasm_num_compilation_tasks > 0) {
     auto job_handle = V8::GetCurrentPlatform()->PostJob(
         TaskPriority::kUserVisible, std::move(job));
+    // When shutdown already started |PostJob| might return invalid
+    // handle. As we're already shutting down, there's no need to
+    // run compilation job.
+    if (!job_handle || !job_handle->IsValid()) {
+      return;
+    }
 
     // Wait for completion, while contributing to the work.
     job_handle->Join();