Skip to content

goto-symex-is-constant: treat x * sizeof(t) and sizeof(t) * x alike #4574

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

smowton
Copy link
Contributor

@smowton smowton commented Apr 26, 2019

Previously it would refuse and allow constant propagation respectively. (Needs a test)

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.

A test should probably just look at the output of --program-only or --show-vcc.

@smowton smowton force-pushed the smowton/fix/brittle-goto-symex-is-constant branch 2 times, most recently from b8dd372 to a85ed3b Compare April 29, 2019 10:14
@smowton
Copy link
Contributor Author

smowton commented Apr 29, 2019

@tautschnig turned out I can only unit-test this in mainline cbmc as its simplifier always wants to swap the operand order so the constant (sizeof) comes first. Still, that seems like a brittle requirement, so I've made a unit test to check that ordering isn't required.

@tautschnig
Copy link
Collaborator

@smowton I feared as much, but this PR helps us stay out of trouble in light of the existing PRs that disable sorting in the simplifier. Thank you for adding a unit test!

Previously it would refuse and allow constant propagation respectively.
@smowton smowton force-pushed the smowton/fix/brittle-goto-symex-is-constant branch from a85ed3b to eb7fc4b Compare April 29, 2019 12:38
@smowton smowton merged commit 0128bb2 into diffblue:develop Apr 29, 2019
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.

3 participants