v8/test/mjsunit/regress/regress-crbug-762472.js
Michael Starzinger 54a3027033 [asm.js] Gracefully handle stack overflow in start function.
R=clemensh@chromium.org
TEST=mjsunit/regress/regress-crbug-762472
BUG=chromium:762472

Change-Id: I8977fb9c9330f03641291b08cf803d0117b7a96a
Reviewed-on: https://chromium-review.googlesource.com/652478
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47852}
2017-09-06 15:03:13 +00:00

27 lines
555 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.
// Flags: --stack-size=100
function Module() {
"use asm";
function f() {}
return { f:f }
}
function InstantiateNearStackLimit() {
try {
var fuse = InstantiateNearStackLimit();
if (fuse == 0) Module();
return fuse - 1;
} catch(e) {
return init_fuse;
}
}
var init_fuse = 0;
for (init_fuse = 0; init_fuse < 10; init_fuse++) {
InstantiateNearStackLimit();
}