Skip to content

Conversation

@Cheekie25
Copy link
Contributor

According to the lcov documentation, FN field can contain optional end line number.
Right now the code crashes in this case.
This commit makes sure it doesn't and it's well parsed.

Ref: https://manpages.ubuntu.com/manpages/noble/man1/geninfo.1.html

       Following is a list of line numbers for each function name found in the source file:

         FN:<line number of function start>,(<line number of function end>,)?<function name>

       The 'end' line number is optional, and is generated only if the compiler/toolchain version
       is  recent  enough  to  generate  the  data  (e.g., gcc 9 or newer).

@RPGillespie6
Copy link
Owner

Similar to #104, do you mind adding a test case to run_all.sh that exercises this corner case through fastcov? It helps with preventing regressions during future refactors/rewrites

@Cheekie25 Cheekie25 force-pushed the handle_lcov_end_line_number branch 2 times, most recently from a3cedc0 to 3f372e5 Compare December 7, 2024 13:25
According to the lcov documentation, `FN` field can contain optional
end line number.
Right now the code crashes in this case.
This commit makes sure it doesn't and it's well parsed.

Ref: https://manpages.ubuntu.com/manpages/noble/man1/geninfo.1.html

```
       Following is a list of line numbers for each function name found in the source file:

         FN:<line number of function start>,(<line number of function end>,)?<function name>

       The 'end' line number is optional, and is generated only if the compiler/toolchain version
       is  recent  enough  to  generate  the  data  (e.g., gcc 9 or newer).
```
@Cheekie25 Cheekie25 force-pushed the handle_lcov_end_line_number branch from 3f372e5 to a9f3f39 Compare December 7, 2024 13:25
@RPGillespie6 RPGillespie6 merged commit 740b553 into RPGillespie6:master Dec 7, 2024
1 check passed
@RPGillespie6
Copy link
Owner

Looks good, thanks for adding the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants