Repository navigation
Conversation
…n limit Both recurse natively over the object graph without going through check_runtime_limits, so a deeply nested value overflows the native stack and aborts the process (about 2.7k levels on a 2 MiB thread). Check the recursion limit per nesting level and throw the uncatchable RuntimeLimit error instead, like the other native recursion cases.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5637.
It changes the following:
Context::check_native_recursion(extra_depth), which applies the existing recursion limit (frames + host calls + extra native depth).JSON.stringify(object and array serialization) andJsValue::to_jsoncall it per nesting level, using the length of their existing cycle-detection set as the depth. Past the limit they return the uncatchableRuntimeLimitError::Recursion, like the other native recursion cases, instead of overflowing the native stack.JSON.stringifyandto_json(these abort the test process without the check), and a 100-level array that still serializes under a limit of 128.Note for review: with the default recursion limit (512),
JSON.stringifyof values nested deeper than about 512 levels now errors. Embedders can raise the limit; a separate JSON-specific limit is an alternative if preferred.cargo test -p boa_engine --libpasses (1142 tests); I did not run test262.