Commit 85b8c2dc authored by yangguo's avatar yangguo Committed by Commit bot

Fix observable array access when formatting stack trace.

This is a fix intended to be merged. Ideally messages.js should be rewritten.

R=bmeurer@chromium.org
BUG=chromium:617527

Review-Url: https://codereview.chromium.org/2044823002
Cr-Commit-Position: refs/heads/master@{#36775}
parent a61cae10
......@@ -530,13 +530,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];
// For traps in wasm, the bytecode offset is passed as (-1 - offset).
// Otherwise, lookup the position from the pc.
var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment