Skip to content

Conversation

satabin
Copy link
Member

@satabin satabin commented Sep 25, 2025

The recursive call is sadly not in tail position, so it does use stack when comparing sibling fields. This change suspends the recursive call within an Eval, which turns it into a stack safe version.

Without the change, the two added tests fail with a StackOverflow.

The recursive call is sadly not in tail position, so it does use stack
when comparing sibling fields. This change suspends the recursive call
within an `Eval`, which turns it into a stack safe version.

Without the change, the two added tests fail with a `StackOverflow`.
@satabin satabin added this to the 4.6.1 milestone Sep 25, 2025
@satabin satabin added the bug label Sep 25, 2025
@satabin satabin requested a review from ybasket September 25, 2025 13:25
@satabin satabin merged commit 1fd65da into v4.6.x Sep 25, 2025
25 checks passed
@satabin satabin deleted the stack-overflow-nested branch September 25, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants