Skip to content

[SV-COMP'18 7/19] Ensure that local declarations do not introduce spurious dead warnings #1996

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
wants to merge 1 commit into from

Conversation

tautschnig
Copy link
Collaborator

No description provided.

state.level2.current_names.end())
state.level2.current_names[l1_identifier]=std::make_pair(ssa, 0);
state.level2.current_names.insert(
std::make_pair(l1_identifier, std::make_pair(ssa, 0)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: might as well emplace, rather than make pair then insert

^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an extra no-match line for the particular warning you were seeing?

Copy link
Contributor

@thk123 thk123 left a comment

Choose a reason for hiding this comment

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

Can't figure out exactly case this is handling as not very familiar with goto_check so some superficial suggestions and a request for some documentation

{
if(enable_pointer_check)
{
assert(i.code.operands().size()==1);
Copy link
Contributor

Choose a reason for hiding this comment

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

INVARIANT here?

// reset the dead marker
goto_programt::targett t=new_code.add_instruction(ASSIGN);
exprt address_of_expr=address_of_exprt(variable);
exprt lhs=ns.lookup(CPROVER_PREFIX "dead_object").symbol_expr();
Copy link
Contributor

Choose a reason for hiding this comment

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

If "dead_object" is a magic string, is it already defined somewhere else? (A quick search of the code says no - it'd be nice to pull it out rather than introduce another duplication of it)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ignorant of this code, is this somehow the point where the variable that's declared goes out of scope? If you do pull out the "dead_object" string, it'd be great to document there what this variable is.

exprt rhs=
if_exprt(
equal_exprt(lhs, address_of_expr),
null_pointer_exprt(to_pointer_type(address_of_expr.type())),
Copy link
Contributor

Choose a reason for hiding this comment

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

might be clearer to use lhs.type() (since either equal or typecast and therefore equal?)

@@ -1666,6 +1666,34 @@ void goto_checkt::goto_check(
}
}
}
else if(i.is_decl())
{
if(enable_pointer_check)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am unfamiliar with this code so non-blocking (I don't understand why dead statements need this instrumentation), but some documentation of why a deceleration statement needs to be instrumented when enable_pointer_check is on would be appreciated

@tautschnig
Copy link
Collaborator Author

This problem has been solved by #3980.

@tautschnig tautschnig closed this Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants