Skip to content

Fix panic in multi_buffer::Anchor::is_valid (#55644) (cherry-pick to preview) - #55647

Merged
zed-zippy[bot] merged 1 commit into
v1.1.xfrom
cherry-pick-v1.1.x-11371e6e
May 4, 2026
Merged

zed-zippy[bot] merged 1 commit into
v1.1.xfrom
cherry-pick-v1.1.x-11371e6e

Conversation

@zed-zippy

@zed-zippy zed-zippy Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #55644 to preview


We check is_valid by seeking to the first excerpt that is >= the
anchor, and comparing the anchor to the excerpt's start and end. But we
were missing a check for the case where seeking puts us on an excerpt
for a different buffer, for example when the anchor to be checked is
past the end of the context range for its buffer's last excerpt.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX
    checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed a panic in multibuffers.

We check `is_valid` by seeking to the first excerpt that is `>=` the
anchor, and comparing the anchor to the excerpt's start and end. But we
were missing a check for the case where seeking puts us on an excerpt
for a different buffer, for example when the anchor to be checked is
past the end of the context range for its buffer's last excerpt.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a panic in multibuffers.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 4, 2026
@zed-community-bot zed-community-bot Bot added the bot Pull requests authored by a bot label May 4, 2026
@zed-zippy
zed-zippy Bot merged commit 29bcbae into v1.1.x May 4, 2026
39 checks passed
@zed-zippy
zed-zippy Bot deleted the cherry-pick-v1.1.x-11371e6e branch May 4, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant