Fix LSP panic on out-of-bounds float values - #10859
Open
JRI98 wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryThe PR prevents LSP document synchronization handlers from panicking when versions or range positions contain non-finite or out-of-bounds floating-point values.
Confidence Score: 5/5The PR appears safe to merge, with the changed conversion paths preventing the reported panics without introducing a concrete regression. Invalid or out-of-range numeric inputs are now checked before integer conversion, valid inputs retain their prior behavior, and no blocking or independently actionable non-blocking issue remains.
|
| Filename | Overview |
|---|---|
| src/lsp/handlers/did_change.zig | Adds finite-value and integer-bound checks for versions and range indices while treating invalid client changes as warning-level failures; no changed-code defect identified. |
| src/lsp/handlers/did_open.zig | Guards float-to-i64 version conversion and falls back safely for invalid values; no changed-code defect identified. |
| src/lsp/test/handler_unit_tests.zig | Adds regression coverage ensuring out-of-bounds float inputs do not panic and valid integral floats remain accepted. |
Reviews (1): Last reviewed commit: "Fix LSP panic on out-of-bounds float val..." | Re-trigger Greptile
JRI98
enabled auto-merge
August 19, 2026 00:39
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.
Document synchronization notification handlers panicked when converting floating-point versions or range positions that were non-finite or exceeded destination integer limits.
This was addressed by validating floating-point inputs against integer boundaries before converting them, safely falling back to default values or rejecting invalid ranges, and lowered invalid client notification logs to warnings.
Fixes #10856