v8/test/mjsunit/regress/regress-799690.js
Clemens Hammacher 54cb64ac94 [asm] Store source position for all loops
Loop headers contain a stack check in wasm, hence an exception can be
thrown at the position of the loop instruction. This means that for
asm.js, we need to store a source position for each loop instruction.

R=mstarzinger@chromium.org

Bug: chromium:799690
Change-Id: I129abef11461992e2f10af8e6afc28ce1cf83341
Reviewed-on: https://chromium-review.googlesource.com/856338
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50443}
2018-01-09 13:56:28 +00:00

22 lines
419 B
JavaScript

// Copyright 2018 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=500
function asm() {
"use asm";
function f(a) {
a = a | 0;
while (1) return 1;
return 0;
}
return { f: f};
}
const mod = asm();
function call_f() {
mod.f();
call_f();
}
assertThrows(call_f, RangeError);