Skip to content

Remove Throwing-NULL check from goto_check_ct #6685

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

Merged
Merged
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
21 changes: 0 additions & 21 deletions src/analyses/goto_check_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2170,27 +2170,6 @@ void goto_check_ct::goto_check(
}
else if(i.is_throw())
{
if(
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't that go into java_bytecode/goto_check_java then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sort of, except goto_check_java should actually just be removed. See #6687 (and then #6686).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And then also goto_check_java actually has this code. I previously made it conditional on --pointer-check in there, just to realise that it actually is dead code.

i.get_code().get_statement() == ID_expression &&
i.get_code().operands().size() == 1 &&
i.get_code().op0().operands().size() == 1)
{
// must not throw NULL

exprt pointer = to_unary_expr(i.get_code().op0()).op();

const notequal_exprt not_eq_null(
pointer, null_pointer_exprt(to_pointer_type(pointer.type())));

add_guarded_property(
not_eq_null,
"throwing null",
"pointer dereference",
i.source_location(),
pointer,
identity);
}

// this has no successor
assertions.clear();
}
Expand Down