-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(papyrus-vm): add stack overflow protection (#2077)
- Loading branch information
Showing
8 changed files
with
130 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const assert = require("node:assert"); | ||
|
||
const main = async () => { | ||
// dlc1chauruscocoonscript infinite recursion next tick after calling getFormEx | ||
mp.callPapyrusFunction("global", "Game", "getFormEx", null, [33565538]); | ||
|
||
await new Promise((resolve) => setTimeout(resolve, 500)); | ||
}; | ||
|
||
main().then(() => { | ||
console.log("Test passed!"); | ||
process.exit(0); | ||
}).catch((err) => { | ||
console.log("Test failed!") | ||
console.error(err); | ||
process.exit(1); | ||
}); | ||
|
||
// Will output: | ||
// [error] ActivePexInstance::StartFunction - Stack overflow in script DLC1ChaurusCocoonScript, returning None | ||
// This is a sign that server isn't gonna crash | ||
|
||
// Triggers only after 2-nd start of the server (needs world to be initially here) |
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
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
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
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