Skip to content

Fix property sort #5214

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 4 commits into from
Jan 22, 2020
Merged

Fix property sort #5214

merged 4 commits into from
Jan 22, 2020

Conversation

thk123
Copy link
Contributor

@thk123 thk123 commented Jan 22, 2020

The sorting of properties was unstable if the properties differed only by name. See
dd45c95 to see the fix in isolation.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [n.a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • 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).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

const auto right_id_name = right_split.first;
const auto right_id_number = right_split.second;

if(left_id_name != right_id_name)

Choose a reason for hiding this comment

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

FYI this is the same as std::tie(left_id_name, left_id_number) < std::tie(right_id_name, right_id_number).

Copy link
Contributor

@xbauch xbauch left a comment

Choose a reason for hiding this comment

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

Looks good.

@thk123 thk123 force-pushed the thk/fix-property-sort branch from dd45c95 to d34902c Compare January 22, 2020 11:37
@thk123 thk123 force-pushed the thk/fix-property-sort branch from d34902c to ac888bb Compare January 22, 2020 11:38
thk123 pushed a commit to thk123/gnat2goto that referenced this pull request Jan 22, 2020
Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the added unit tests too!

@thk123 thk123 merged commit 4682d07 into diffblue:develop Jan 22, 2020
@thk123 thk123 deleted the thk/fix-property-sort branch January 22, 2020 13:38
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: ac888bb).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/145556447
Status will be re-evaluated on next push.
Common spurious failures include: 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); compatibility was already broken by an earlier merge.

thk123 pushed a commit to thk123/gnat2goto that referenced this pull request Jan 22, 2020
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.

5 participants