From 38b9b32a3ba6200acbe9dc921b2ad94e433ce704 Mon Sep 17 00:00:00 2001 From: StefanStojanovic Date: Tue, 17 Mar 2026 10:35:08 +0100 Subject: [PATCH] deps: patch V8 to fix Windows build Signed-off-by: Joyee Cheung PR-URL: https://github.com/nodejs/node/pull/65161 Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau --- common.gypi | 2 +- deps/v8/include/v8-internal.h | 4 ++++ deps/v8/src/objects/backing-store.cc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 1c8155701c0..da5d7bac749 100644 --- a/common.gypi +++ b/common.gypi @@ -44,7 +44,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.5', + 'v8_embedder_string': '-node.6', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 9c842823320..4ce3e6e3055 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -526,7 +526,11 @@ struct TagRange { constexpr TagRange(Tag first, Tag last) : first(first), last(last) { #ifdef V8_ENABLE_CHECKS // This would typically be a DCHECK, but that's not available here. +#if V8_HAS_BUILTIN_UNREACHABLE if (first > last) __builtin_unreachable(); // Invalid tag range. +#elif defined(_MSC_VER) + if (first > last) __assume(0); // Invalid tag range. +#endif #endif } diff --git a/deps/v8/src/objects/backing-store.cc b/deps/v8/src/objects/backing-store.cc index 839acf15f16..beab4e44b29 100644 --- a/deps/v8/src/objects/backing-store.cc +++ b/deps/v8/src/objects/backing-store.cc @@ -323,7 +323,7 @@ std::unique_ptr BackingStore::TryAllocateAndPartiallyCommitMemory( // For accounting purposes, whether a GC was necessary. bool did_retry = false; - auto gc_retry = [&](const std::function& fn) { + auto gc_retry = [&](const auto& fn) { if (fn()) return true; // Collect garbage and retry. did_retry = true;