-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: prevent crash in TTYWrap::Initialize
When console.log is called for the first time it initializes TTYWrap object. However, if there is not enough space on the V8 stack, creating function template fails and triggers empty maybe local exception. PR-URL: #26832 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
Showing
2 changed files
with
26 additions
and
5 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,20 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
// This test ensures that console.log | ||
// will not crash the process if there | ||
// is not enough space on the V8 stack | ||
|
||
const done = common.mustCall(() => {}); | ||
|
||
async function test() { | ||
await test(); | ||
} | ||
|
||
(async () => { | ||
try { | ||
await test(); | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
})().then(done, done); |