Skip to content

Select instruction with non-empty function in coverage block [TG-2341] #1799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/goto-instrument/cover_basic_blocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ cover_basic_blockst::cover_basic_blockst(const goto_programt &_goto_program)

// set representative program location to instrument
if(
!it->function.empty() &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an invariant, I'd say. So I'd turn this on its head: fix the code that generates new instructions without setting their function field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Let me check how big this piece of work will be. I will then put an INVARIANT in goto_programt::update.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 -- I'd always thought this was a DATA_INVARIANT(). It would certainly be Very Useful if it was.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1843 regarding my investigations on this topic.

!it->source_location.is_nil() &&
!it->source_location.get_file().empty() &&
!it->source_location.get_line().empty() &&
Expand Down