-
Notifications
You must be signed in to change notification settings - Fork 273
[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
Conversation
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))); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this 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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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())), |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
This problem has been solved by #3980. |
No description provided.