Skip to content

Fix cases where error recovery could infinite loop#4257

Merged
maxbrunsfeld merged 7 commits intomasterfrom
error-recovery-fixes
Mar 4, 2025
Merged

Fix cases where error recovery could infinite loop#4257
maxbrunsfeld merged 7 commits intomasterfrom
error-recovery-fixes

Conversation

@maxbrunsfeld
Copy link
Contributor

No description provided.

We found this problem when debugging an infinite loop that happened
during error recovery when using the Zig grammar. The large number of
unnecessary paused stack versions were preventing the correct recovery
strategy from being tried.
@maxbrunsfeld maxbrunsfeld changed the title Error recovery fixes Fix cases where error recovery could infinite loop Mar 4, 2025
@maxbrunsfeld maxbrunsfeld merged commit 066fd77 into master Mar 4, 2025
19 checks passed
@maxbrunsfeld maxbrunsfeld deleted the error-recovery-fixes branch March 4, 2025 21:50
@clason clason added the ci:backport release-0.25 Backport label label Mar 4, 2025
@tree-sitter-ci-bot
Copy link

Successfully created backport PR for release-0.25:

github-actions bot pushed a commit that referenced this pull request Mar 4, 2025
* Rename corpus test functions to allow easy filtering by language

* Use usize for seed argument

* Avoid retaining useless stack versions when reductions merge

We found this problem when debugging an infinite loop that happened
during error recovery when using the Zig grammar. The large number of
unnecessary paused stack versions were preventing the correct recovery
strategy from being tried.

* Fix leaked lookahead token when reduction results in a merged stack

* Enable running PHP tests in CI

* Fix possible infinite loop during error recovery at EOF

* Account for external scanner state changes when detecting changed ranges in subtrees

(cherry picked from commit 066fd77)
maxbrunsfeld added a commit that referenced this pull request Mar 4, 2025
* Rename corpus test functions to allow easy filtering by language

* Use usize for seed argument

* Avoid retaining useless stack versions when reductions merge

We found this problem when debugging an infinite loop that happened
during error recovery when using the Zig grammar. The large number of
unnecessary paused stack versions were preventing the correct recovery
strategy from being tried.

* Fix leaked lookahead token when reduction results in a merged stack

* Enable running PHP tests in CI

* Fix possible infinite loop during error recovery at EOF

* Account for external scanner state changes when detecting changed ranges in subtrees

(cherry picked from commit 066fd77)

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
maxbrunsfeld added a commit to zed-industries/zed that referenced this pull request Mar 5, 2025
maxbrunsfeld added a commit to zed-industries/zed that referenced this pull request Mar 5, 2025
For tree-sitter/tree-sitter#4257

Release Notes:

- Fixed a hang that could occur when editing certain Zig files.
maxbrunsfeld added a commit to zed-industries/zed that referenced this pull request Mar 5, 2025
For tree-sitter/tree-sitter#4257

Release Notes:

- Fixed a hang that could occur when editing certain Zig files.
rtfeldman pushed a commit to zed-industries/zed that referenced this pull request Mar 6, 2025
For tree-sitter/tree-sitter#4257

Release Notes:

- Fixed a hang that could occur when editing certain Zig files.
@tree-sitter tree-sitter deleted a comment from Parvej6289 Apr 24, 2025
@tree-sitter tree-sitter locked as spam and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants