-
Notifications
You must be signed in to change notification settings - Fork 277
Use null check annotation everywhere #1229
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -909,7 +909,7 @@ void goto_checkt::pointer_validity_check( | |
const exprt &access_ub, | ||
const irep_idt &mode) | ||
{ | ||
if(mode!=ID_java && !enable_pointer_check) | ||
if(!enable_pointer_check) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes: if for some reason you want to use goto-check on Java code (probably in this case you have omitted or customised java-bytecode-instrument in some custom driver program), the checks below that point are still inapplicable to Java. |
||
return; | ||
|
||
const exprt &pointer=expr.op0(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ Author: Daniel Kroening, kroening@kroening.com | |
#include <util/type.h> | ||
#include <util/symbol_table.h> | ||
#include <util/message.h> | ||
#include <util/std_expr.h> | ||
|
||
#include "java_bytecode_parse_tree.h" | ||
|
||
|
@@ -64,4 +65,9 @@ irep_idt resolve_friendly_method_name( | |
const symbol_tablet &symbol_table, | ||
std::string &error); | ||
|
||
/// Dereference an expression and flag it for a null-pointer check | ||
/// \param expr: expression to dereference and check | ||
/// \param type: expected result type (typically expr.type().subtype()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the documentation be in the cpp file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to be normal for that header. Personally I prefer the docs in the header, but we should move or keep en masse. |
||
dereference_exprt checked_dereference(const exprt &expr, const typet &type); | ||
|
||
#endif // CPROVER_JAVA_BYTECODE_JAVA_UTILS_H |
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.
Why is this line (and others in cbmc-java) being removed? Should the test (ideally) be modified to stop it being trivially simplified?
Uh oh!
There was an error while loading. Please reload this page.
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.
When the simplifier gives a SUCCESSFUL verdict you don't get the specific goal printouts (cf. if it was just complicated enough to use the BMC). Perhaps that ought to change, but I'd like to do that elsewhere if so. I'm unsure exactly how this now passes the simplifier and didn't before (suspect: typecasts, which are now less likely to occur nested?) However a look over the GOTO programs for the tests shows they're still testing what they intended to, so I don't think the tests are any more or less trivial than they were before.