From ef7ffce7cf4413415285ad8f2e4de302eaedefd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Tue, 21 Apr 2026 07:11:01 +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 PR-URL: https://github.com/nodejs/node/pull/62795 Refs: https://github.com/nodejs/node/pull/62095 Reviewed-By: Anna Henningsen Reviewed-By: Chengzhong Wu --- 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 4ebb63b2f59..b7d0041d073 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() };