From c72d39f0a17a620c6c21ddda1b7d6a5ccea83de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 7 Jul 2021 13:22:13 +0200 Subject: [PATCH] deps: V8: cherry-pick 0b3a4ecf7083 Original commit message: Fix implicit conversion loses integer precision warning The type of m is long in 64 bits build, and results implicit conversion loses integer precision, which was found by improved clang warning (-Wshorten-64-to-32) Bug: chromium:1124085 Change-Id: Ic9f22508bd817a06d5c90162b1ac3554a7171529 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2391323 Commit-Queue: Zequan Wu Auto-Submit: Zequan Wu Reviewed-by: Nico Weber Reviewed-by: Igor Sheludko Cr-Commit-Position: refs/heads/master@{#69686} Refs: https://github.com/v8/v8/commit/0b3a4ecf708334ff20dd5a978c3765e75675b40b PR-URL: https://github.com/nodejs/node/pull/39244 Refs: https://github.com/nodejs/build/issues/2696 Reviewed-By: Richard Lau --- common.gypi | 2 +- deps/v8/src/base/macros.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 0f91d3744130a4c..b622b61086d434b 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.70', + 'v8_embedder_string': '-node.71', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/base/macros.h b/deps/v8/src/base/macros.h index e22dd00895ab7b5..067a9115b26f5c1 100644 --- a/deps/v8/src/base/macros.h +++ b/deps/v8/src/base/macros.h @@ -339,14 +339,14 @@ inline T RoundDown(T x, intptr_t m) { STATIC_ASSERT(std::is_integral::value); // m must be a power of two. DCHECK(m != 0 && ((m & (m - 1)) == 0)); - return x & -m; + return x & static_cast(-m); } template constexpr inline T RoundDown(T x) { STATIC_ASSERT(std::is_integral::value); // m must be a power of two. STATIC_ASSERT(m != 0 && ((m & (m - 1)) == 0)); - return x & -m; + return x & static_cast(-m); } // Return the smallest multiple of m which is >= x.