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

Conversation

peterschrammel
Copy link
Member

Otherwise coverage goals cannot be linked to functions in consumers of CBMC output.

@@ -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.

@peterschrammel
Copy link
Member Author

Obsolete.

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.

3 participants