From 51e4b86e6dcb432ee67bc299babe280a212118a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 27 Sep 2023 15:23:57 +0200 Subject: [PATCH] [js] Handle dead wrappers --- js/src/builtin/Promise.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index daeb2c3d68..7d4c232f2e 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -537,8 +537,12 @@ JSObject* PromiseObject::resolutionSite() { auto debugInfo = PromiseDebugInfo::FromPromise(this); - if (debugInfo) - return debugInfo->resolutionSite(); + if (debugInfo) { + JSObject* site = debugInfo->resolutionSite(); + if (site && !JS_IsDeadWrapper(site)) { + return site; + } + } return nullptr; }