From 40c31fbfc60e877456affb90414f511d560689c6 Mon Sep 17 00:00:00 2001 From: xurui Date: Wed, 29 May 2024 11:41:02 +0800 Subject: [PATCH] =?UTF-8?q?fixed=2036d0b88=20from=20https://gitee.com/clea?= =?UTF-8?q?r=5Faddr/chromium=5Fv8/pulls/56=20=E4=BF=AE=E5=A4=8DCVE-2024-52?= =?UTF-8?q?74?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xurui --- src/ast/scopes.cc | 2 +- src/parsing/parser-base.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc index 762dde7fe..f243e13b2 100644 --- a/src/ast/scopes.cc +++ b/src/ast/scopes.cc @@ -2357,7 +2357,7 @@ bool Scope::MustAllocate(Variable* var) { var->set_is_used(); if (inner_scope_calls_eval_ && !var->is_this()) var->SetMaybeAssigned(); } - DCHECK(!var->has_forced_context_allocation() || var->is_used()); + CHECK(!var->has_forced_context_allocation() || var->is_used()); // Global variables do not need to be allocated. return !var->IsGlobalObjectProperty() && var->is_used(); } diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h index 4d2a037a4..90a121c3e 100644 --- a/src/parsing/parser-base.h +++ b/src/parsing/parser-base.h @@ -2565,6 +2565,7 @@ typename ParserBase::BlockT ParserBase::ParseClassStaticBlock( } FunctionState initializer_state(&function_state_, &scope_, initializer_scope); + FunctionParsingScope body_parsing_scope(impl()); AcceptINScope accept_in(this, true); // Each static block has its own var and lexical scope, so make a new var -- Gitee