fix: handle optional DA checksum field in LCOV parser#1500
Closed
robertomlsoares wants to merge 1 commit into
Closed
fix: handle optional DA checksum field in LCOV parser#1500robertomlsoares wants to merge 1 commit into
robertomlsoares wants to merge 1 commit into
Conversation
d7cf84b to
3dd08df
Compare
The LCOV format allows an optional checksum field on DA lines: DA:line_number,execution_count[,checksum] When a checksum starts with 'e', the byte-level parser mistakes it for an "end_of_record" marker, since it only checks the first byte. This causes a panic at parser.rs:194 (unwrap on None). The fix validates the full "end_of_record" string instead of matching on just the 'e' byte. Lines starting with 'e' that don't match "end_of_record" are skipped.
3dd08df to
2bbf848
Compare
Author
|
Looks like the linter is failing on pre-existing code. |
Author
|
I have tried this fix in our systems, and while it did work for checksums starting with |
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.
The LCOV format allows an optional checksum field on DA lines:
DA:line_number,execution_count[,checksum]When a checksum starts with
e, the byte-level parser mistakes it for anend_of_recordmarker, since it only checks the first byte. This causes a panic atparser.rs:194(unwrap onNone).The fix validates the full
end_of_recordstring instead of matching on just theebyte. Lines starting withethat don't matchend_of_recordare skipped.