Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r186606 - REGRESSION (r180248): Repro Crash: com.apple.WebKit.W…
…ebContent at com.apple.JavaScriptCore: JSC::createRangeError + 20 https://bugs.webkit.org/show_bug.cgi?id=146767 Reviewed by Geoffrey Garen. Source/JavaScriptCore: If the stack check fails at the top most frame, we must use that frame to generate the exception. Reverted the code to always use the current frame to throw an out of stack exception. * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): LayoutTests: New test that generates a call to a function that involves creating a huge object literal that exceeds the available stack space. * http/tests/misc/large-js-program-expected.txt: Added. * http/tests/misc/large-js-program.php: Added.
- Loading branch information
1 parent
9d4b8ab
commit bf65cd3
Showing
5 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CONSOLE MESSAGE: line 27: RangeError: Maximum call stack size exceeded. | ||
This tests verifies that a large program doesn't crash JavaScript. | ||
|
||
This test should generate an out of stack exception, but have no other output. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<html> | ||
<head> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
</script> | ||
</head> | ||
<body> | ||
<h1>This tests verifies that a large program doesn't crash JavaScript.</h1> | ||
<p>This test should generate an out of stack exception, but have no other output. | ||
<br> | ||
<pre id="console"></pre> | ||
<script src="/js-test-resources/js-test-pre.js"></script> | ||
<script> | ||
function print(m) | ||
{ | ||
document.getElementById("console").innerHTML += m + "<br>"; | ||
} | ||
|
||
function foo(o) | ||
{ | ||
// We should not get to this code, we should throw an out of stack exception calling foo(). | ||
testFailed("We should never get here!"); | ||
} | ||
|
||
|
||
foo({"x": 1, | ||
"a": [ | ||
<?php | ||
for ($i = 0; $i < 1000000; $i++) { | ||
if ($i != 0) | ||
echo ",\n"; | ||
echo "[0, $i]"; | ||
} | ||
?> | ||
]}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters