-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use JSON.stringify to trigger stack overflow
V8's interpreter performs stack checks both at the call site and at the function entry. A recursive function could therefore trigger stack overflow at two different source locations. Instead of recursion, call JSON.stringify on a deeply nested array.
- Loading branch information
Showing
2 changed files
with
9 additions
and
7 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
before | ||
|
||
*test*message*stack_overflow.js:* | ||
function stackOverflow() { | ||
^ | ||
JSON.stringify(array); | ||
^ | ||
|
||
RangeError: Maximum call stack size exceeded |