Skip to content

llvm2lcov: use ignorable_error rather than die for unsupported MC/DC entries format#474

Merged
henry2cox merged 1 commit into
linux-test-project:masterfrom
belyaevrd:llvm-checking-versions
May 21, 2026
Merged

llvm2lcov: use ignorable_error rather than die for unsupported MC/DC entries format#474
henry2cox merged 1 commit into
linux-test-project:masterfrom
belyaevrd:llvm-checking-versions

Conversation

@belyaevrd
Copy link
Copy Markdown
Contributor

No description provided.

…entries format

Signed-off-by: Roman Beliaev <r.beliaev@ispras.ru>
@belyaevrd belyaevrd mentioned this pull request May 20, 2026
@henry2cox
Copy link
Copy Markdown
Collaborator

In this particular case: I think it is (moderately) safe to continue after noticing the issue - unless the array size is less than 10
Or maybe, if the list size is less larger and the 10th element (index 9) is not an array.
That is:
last if $mSize < 10 || ref($m->[9]) ne 'ARRAY'
But that might be too confusing/hard to document/hard for the user to understand what is happening.
So it might be better to just skip the MC/DC entry if the format is not what we expected.
User will then get a later error, when there are no MC/DC coverpoints despite the --mcdc command line argument.

@belyaevrd
Copy link
Copy Markdown
Contributor Author

In this particular case: I think it is (moderately) safe to continue after noticing the issue - unless the array size is less than 10

I think that if the MC/DC entries format is unexpected, then these entries might have fields that are very different from the expected ones (i.e., having a new field at the beginning). This can lead to broken results.
So, for me, this exact version checking makes sense.

Or maybe, if the list size is less larger and the 10th element (index 9) is not an array.
That is:
last if $mSize < 10 || ref($m->[9]) ne 'ARRAY'
But that might be too confusing/hard to document/hard for the user to understand what is happening.
So it might be better to just skip the MC/DC entry if the format is not what we expected.
User will then get a later error, when there are no MC/DC coverpoints despite the --mcdc command line argument.

Do you want to remove ignorable_error and just leave the loop via last? I agree with you that it might be too confusing for the user. However, if you want to prevent emitting two errors in such situations, I can remove it.

@henry2cox
Copy link
Copy Markdown
Collaborator

Actually - I think your reasoning above is correct...someone might change the data layout in a way we don't expect - so simply skipping the MC/DC entry after emitting a message is probably the best approah.
It also means that any user who hits the message and really wants MC/DC support, will have to either report the issue or fix it themselves. (Hopefully: sending PR after fix.)

Lets leave this PR as is...I'll merge it tomorrow if nobody else comments between now and then.

@henry2cox henry2cox merged commit 4dcdd6f into linux-test-project:master May 21, 2026
5 checks passed
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