v8/test/mjsunit/regress/regress-689016.js
petermarshall f4739ea863 [builtins] Fix crash on stack overflow in CheckSpreadAndPushToStack.
For x64, ia32 and x87 we would pop the return address before the stack
overflow check. This meant the stack couldn't be unwound properly if
it was going to overflow. This CL moves the pop of the return address
to after the stack overflow check.

Also adds a regression test to check that a RangeError is thrown.

BUG=689016

Review-Url: https://codereview.chromium.org/2681643004
Cr-Commit-Position: refs/heads/master@{#42984}
2017-02-07 09:58:19 +00:00

13 lines
280 B
JavaScript

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function() {
function f() {}
assertThrows(function() {
f(...Array(1000000));
}, RangeError);
})();