From db4b19211349945015a3096d796ee0d6bd18c46d 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 4ee97e24cacb74..79ad3dfe2d071b 100644 --- a/src/util.h +++ b/src/util.h @@ -772,6 +772,7 @@ class PersistentToLocal { template static inline v8::Local Strong( const v8::PersistentBase& persistent) { + DCHECK(!persistent.IsWeak()); return *reinterpret_cast*>( const_cast*>(&persistent)); }