Repository navigation
Limit how deep macro XML nests - #104
Merged
Merged
Conversation
…s an error rather than a stack overflow - Building the statements of the tree, copying and dropping it, and making its JavaScript objects in Wasm recur on each level; in Wasm, with its 1 MB A295 stack, about 2,000 levels of statement groups, some 230 KB of XML, used up the stack and trapped, and the CLI aborted at about 16,000 - parse_xml_tree, which does not recur, returns InvalidMacroData when the elements nest deeper than 256; macros Access makes nest a few levels - Test that 256 levels read and give their statements, that 257 are an error, and that 100,000 are an error without using up the stack, also on WASI Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The limit on the depth added to its complexity, so open_element now checks the depth and opens an element at a start tag, and resolve_reference resolves an entity or character reference - parse_xml_tree goes from a cyclomatic complexity of 25, a cognitive complexity of 15 and 90 lines to 21, 13 and 71 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
🤖 Generated with Claude Code