deps,v8: cherry-pick 385aa80

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 <titzer@chromium.org>
    Commit-Queue: Ben Titzer <titzer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#59868}

Refs: 385aa80aff

PR-URL: https://github.com/nodejs/node/pull/26702
Fixes: https://github.com/nodejs/node/issues/26694
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
pull/26702/head
Refael Ackermann 2019-03-16 10:44:59 -04:00
parent f1056542f0
commit 8e308e8b28
3 changed files with 3 additions and 3 deletions

View File

@ -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 #####

1
deps/v8/AUTHORS vendored
View File

@ -46,6 +46,7 @@ Alexander Botero-Lowry <alexbl@FreeBSD.org>
Alexander Karpinsky <homm86@gmail.com>
Alexandre Vassalotti <avassalotti@gmail.com>
Alexis Campailla <alexis@janeasystems.com>
Allan Sandfeld Jensen <allan.jensen@qt.io>
Amos Lim <eui-sang.lim@samsung.com>
Andreas Anyuru <andreas.anyuru@gmail.com>
Andrew Paprocki <andrew@ishiboo.com>

View File

@ -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()));