From 8e308e8b2804344768037b5764328cf5cfdfaade Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Sat, 16 Mar 2019 10:44:59 -0400 Subject: [PATCH] deps,v8: cherry-pick 385aa80 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: Correct removal of redundant moves The logic for removing while iterating is non-standard and a left over from a previous index based loop. This patch replaces it with a standard erase based version. This fixes a runtime crash with MSVC that invalidates the iterator and then asserts. This also makes the code safe in case the last move can be redundant. Change-Id: Ie6990e0d65a3b83a4b7da3e2e89ed4e60a6cd215 Reviewed-on: https://chromium-review.googlesource.com/c/1488762 Reviewed-by: Ben Titzer Commit-Queue: Ben Titzer Cr-Commit-Position: refs/heads/master@{#59868} Refs: https://github.com/v8/v8/commit/385aa80aff32210d098498d1cd44d42bc70ee1d4 PR-URL: https://github.com/nodejs/node/pull/26702 Fixes: https://github.com/nodejs/node/issues/26694 Reviewed-By: Richard Lau Reviewed-By: Ujjwal Sharma Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Michaƫl Zasso --- common.gypi | 2 +- deps/v8/AUTHORS | 1 + deps/v8/src/compiler/backend/gap-resolver.cc | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index b95823a237092f..a44de87bc20df8 100644 --- a/common.gypi +++ b/common.gypi @@ -37,7 +37,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.6', + 'v8_embedder_string': '-node.7', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index bea5f9ae85c601..ecf0e5d1fbebe9 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -46,6 +46,7 @@ Alexander Botero-Lowry Alexander Karpinsky Alexandre Vassalotti Alexis Campailla +Allan Sandfeld Jensen Amos Lim Andreas Anyuru Andrew Paprocki diff --git a/deps/v8/src/compiler/backend/gap-resolver.cc b/deps/v8/src/compiler/backend/gap-resolver.cc index 6cb7d7fbaf3b37..1758ca2c5adb71 100644 --- a/deps/v8/src/compiler/backend/gap-resolver.cc +++ b/deps/v8/src/compiler/backend/gap-resolver.cc @@ -96,8 +96,7 @@ void GapResolver::Resolve(ParallelMove* moves) { for (auto it = moves->begin(); it != moves->end();) { MoveOperands* move = *it; if (move->IsRedundant()) { - *it = moves->back(); - moves->pop_back(); + it = moves->erase(it); continue; } source_kinds.Add(GetKind(move->source()));