Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lite: tweak nest limit on stack overflow test #1106

Merged
merged 1 commit into from Oct 15, 2023

Conversation

BurntSushi
Copy link
Member

It looks like the default nest limit is maybe a little big in some environments? So shrink it down more.

It turns out that we missed another case where the stack could overflow:
dropping a deeply nested Hir. Namely, since we permit deeply nested Hirs
to be constructed and only reject them after determining they are too
deeply nested, they still then need to be dropped. We fix this by
implementing a custom a Drop impl that uses the heap to traverse the Hir
and drop things without using unbounded stack space.

An alternative way to fix this would be to adjust the parser somehow to
avoid building deeply nested Hir values in the first place. But that
seems trickier, so we just stick with this for now.
@BurntSushi BurntSushi merged commit 0086dec into master Oct 15, 2023
16 checks passed
@BurntSushi BurntSushi deleted the ag/tweak-lite-overflow-test branch October 15, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant