From 08e2b0408a92473d0c627786d72c193837349b27 Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Fri, 12 Aug 2016 10:02:00 +0200 Subject: [PATCH] deps: cherry-pick 7bd24767 from v8 upstream (v6.x) Original commit message: Version 5.1.281.65 (cherry-pick) Merged 85b8c2dc4aee1031ac02f9d7c02d5c1aa76bc2ba Fix observable array access when formatting stack trace. BUG=chromium:617527 LOG=N R=hablich@chromium.org Review URL: https://codereview.chromium.org/2051383002 . Cr-Commit-Position: refs/branch-heads/5.1@{#76} Cr-Branched-From: 167dc63b4c9a1d0f0fe1b19af93644ac9a561e83-refs/heads/5.1.281@{#1} Cr-Branched-From: 03953f52bd4a184983a551927c406be6489ef89b-refs/heads/master@{#35282} PR-URL: https://github.com/nodejs/node/pull/8078 Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Ali Ijaz Sheikh --- deps/v8/include/v8-version.h | 2 +- deps/v8/src/js/messages.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 9f3488fa00fd42..28db453bbff687 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 0 #define V8_BUILD_NUMBER 71 -#define V8_PATCH_LEVEL 60 +#define V8_PATCH_LEVEL 61 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/js/messages.js b/deps/v8/src/js/messages.js index feb14d378844a6..90dd95fe22cb56 100644 --- a/deps/v8/src/js/messages.js +++ b/deps/v8/src/js/messages.js @@ -782,13 +782,15 @@ function FormatErrorString(error) { function GetStackFrames(raw_stack) { + var internal_raw_stack = new InternalArray(); + %MoveArrayContents(raw_stack, internal_raw_stack); var frames = new InternalArray(); - var sloppy_frames = raw_stack[0]; - for (var i = 1; i < raw_stack.length; i += 4) { - var recv = raw_stack[i]; - var fun = raw_stack[i + 1]; - var code = raw_stack[i + 2]; - var pc = raw_stack[i + 3]; + var sloppy_frames = internal_raw_stack[0]; + for (var i = 1; i < internal_raw_stack.length; i += 4) { + var recv = internal_raw_stack[i]; + var fun = internal_raw_stack[i + 1]; + var code = internal_raw_stack[i + 2]; + var pc = internal_raw_stack[i + 3]; var pos = %_IsSmi(code) ? code : %FunctionGetPositionForOffset(code, pc); sloppy_frames--; frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0)));