Skip to content

object_size can now do objects with dynamic size #2852

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 2 commits into from
Aug 31, 2018
Merged

Conversation

kroening
Copy link
Member

No description provided.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Approving with some suggestions below to make understanding the code easier.

if(to_integer(size_expr, object_size))
continue;
object_size =
typecast_exprt::conditional_cast(size_expr, postponed.expr.type());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could the code around here be refactored so that it is trivial that object_size will always be initialised when used below? I'd suggest:

if(expr.id() != ID_symbol)
  continue;

const size_expr = size_of_expr(type, ns);
if(size_expr.is_nil())
  continue;

const exprt object_size =
  typecast_exprt::conditional_cast(size_expr, postponed.expr.type());

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@@ -786,24 +786,19 @@ void bv_pointerst::do_postponed(
{
const exprt &expr=*it;

mp_integer object_size;
exprt object_size;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is no longer needed.

@kroening kroening force-pushed the dynamic_object_size branch 2 times, most recently from 05c7f6e to 86f4394 Compare August 30, 2018 13:20
@kroening kroening requested a review from pkesseli as a code owner August 30, 2018 13:20
@kroening kroening force-pushed the dynamic_object_size branch from 86f4394 to 5641ebc Compare August 30, 2018 13:44
@kroening kroening force-pushed the dynamic_object_size branch from 5641ebc to 11431ea Compare August 30, 2018 17:21
@kroening kroening merged commit 62e7e34 into develop Aug 31, 2018
@kroening kroening deleted the dynamic_object_size branch August 31, 2018 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants