From 212821afdd8f20bb4c4fc1045178c5cee8b33de5 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 28 Apr 2023 19:58:09 +0000 Subject: [PATCH] deps: V8: cherry-pick c5ab3e4f0c5a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: libstdc++: fix incomplete type in v8::internal::is_subtype Using std::convertible with incomplete types is UB. However, till GCC 12 it was accepted and std::convertible returned false. This fails now for e.g. v8::internal::WasmArray. Use std::disjunction and std::conjunction instead which are short- circuiting, because std::is_base_of is already true. Bug: chromium:957519 Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663 Commit-Queue: Stephan Hartmann Reviewed-by: Clemens Backes Cr-Commit-Position: refs/heads/main@{#86904} Refs: https://github.com/v8/v8/commit/c5ab3e4f0c5a3ce880941184ef8447c27cd19a93 PR-URL: https://github.com/nodejs/node/pull/47736 Fixes: https://github.com/nodejs/node/issues/47623 Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng --- common.gypi | 2 +- deps/v8/src/codegen/tnode.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 9b37dc9ff581a3..f8d98fb492db42 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.4', + 'v8_embedder_string': '-node.5', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/codegen/tnode.h b/deps/v8/src/codegen/tnode.h index cd7bd8db98c241..7629e89ad693fe 100644 --- a/deps/v8/src/codegen/tnode.h +++ b/deps/v8/src/codegen/tnode.h @@ -269,8 +269,9 @@ using BuiltinPtr = Smi; template struct is_subtype { static const bool value = - std::is_base_of::value || (std::is_same::value && - std::is_convertible::value); + std::disjunction, + std::conjunction, + std::is_convertible>>::value; }; template struct is_subtype, U> {