From da6785caec544cb0e078b3a8de516e506530fb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= <18708370+Flarna@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:48:31 +0200 Subject: [PATCH] src: use DCHECK in AsyncWrap::MakeCallback instead emiting a warning Replace emitting of a process warning by a DCHECK because the use after free in http parser is fixed now. Refs: https://github.com/nodejs/node/pull/61995#issuecomment-3980534771 Refs: https://github.com/nodejs/node/pull/62095 --- src/async_wrap.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 5007fd34414abf..7b7930187bd530 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -25,9 +25,6 @@ #include "env-inl.h" #include "node_errors.h" #include "node_external_reference.h" -#ifdef DEBUG -#include -#endif #include "tracing/traced_value.h" #include "util-inl.h" @@ -677,13 +674,8 @@ MaybeLocal AsyncWrap::MakeCallback(const Local cb, Local* argv) { EmitTraceEventBefore(); -#ifdef DEBUG - if (context_frame().IsEmpty()) { - ProcessEmitWarning(env(), - "MakeCallback() called without context_frame, " - "likely use after destroy of AsyncWrap."); - } -#endif + // If this check fails it indicates an use after-free. + DCHECK(!context_frame().IsEmpty()); ProviderType provider = provider_type(); async_context context { get_async_id(), get_trigger_async_id() };