From bfd2368c53df320a3667fff92497a392ea982579 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 31 May 2021 21:49:32 +0200 Subject: [PATCH] src: add not-weak DCHECK to PersistentToLocal::Strong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/38821#issuecomment-851644135 PR-URL: https://github.com/nodejs/node/pull/38875 Reviewed-By: Stephen Belanger Reviewed-By: Bryan English Reviewed-By: Gerhard Stöbich Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util.h b/src/util.h index f0fc6097313fe8..0a770110ab579e 100644 --- a/src/util.h +++ b/src/util.h @@ -760,6 +760,7 @@ class PersistentToLocal { template static inline v8::Local Strong( const v8::PersistentBase& persistent) { + DCHECK(!persistent.IsWeak()); return *reinterpret_cast*>( const_cast*>(&persistent)); }