Skip to content

Generalise get_subexpression_at_offset to extract parts of members #3167

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

Conversation

tautschnig
Copy link
Collaborator

This enables re-use in the simplifier and other places. Adding a unit test of
get_subexpression_at_offset.

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

exprt subexpr = get_subexpression_at_offset(
root_object_subexpression, o.offset(), dereference_type, ns);
root_object_subexpression, o.offset(), dereference_type, "", ns);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having an empty string literal, interpreted as an irep ID, to block particular functionality (descending within objects if I understand correctly) does not seem like the most intuitive of designs. I can't immediately suggest better though.

@tautschnig
Copy link
Collaborator Author

Marking do-not-merge as this depends on #3184.

@tautschnig tautschnig mentioned this pull request Oct 15, 2018
3 tasks
@tautschnig tautschnig force-pushed the get_subexpr-parts-of-members branch 2 times, most recently from 8d7fbad to dc227a0 Compare October 29, 2018 20:32
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 8d7fbad).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89566003
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@tautschnig tautschnig force-pushed the get_subexpr-parts-of-members branch from dc227a0 to aa683aa Compare October 29, 2018 21:09
@tautschnig
Copy link
Collaborator Author

Dependencies have been merged, this is now ready for review.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: aa683aa).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89578879
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@kroening kroening removed their assignment Oct 30, 2018
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Recommend name your variables after units given bytes and bits are both used in the same function; otherwise looks good

This enables re-use in the simplifier and other places. Adding a unit test of
get_subexpression_at_offset.
@tautschnig tautschnig force-pushed the get_subexpr-parts-of-members branch from aa683aa to 2ff4d2f Compare October 31, 2018 13:12
@tautschnig tautschnig merged commit b16d247 into diffblue:develop Oct 31, 2018
@tautschnig tautschnig deleted the get_subexpr-parts-of-members branch October 31, 2018 13:55
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 2ff4d2f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89808073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants