-
Notifications
You must be signed in to change notification settings - Fork 273
Record constraints of indexed access to array constants [blocks: #2108] #4673
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
Conversation
There was a problem hiding this 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: 2c30f84).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112368219
/*** Variable non-redundant update ***/ | ||
// No obvious simplifications to writes | ||
|
||
long int nonRedundantWriteLocation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long vs long int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
#include <assert.h> | ||
|
||
// C semantics are that these will be zero | ||
int uninitialisedGlobalArray1[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uninitialized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
} | ||
else | ||
{ | ||
std::vector<std::pair<std::size_t, std::size_t>> ranges; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a two liner to explain what this case is doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - I added a paragraph for each of the two cases.
When even constant arrays are left to be handled by the array theory, expressions such as { 3, 4 }[1] were actually unconstrained as we never recorded the fact that this expression evaluates to 4. To reduce the number of constraints to be generated for non-constant indices, ranges of equal values just yield a single constraint, optimising the case of large zero-initialised arrays.
2c30f84
to
10177c6
Compare
There was a problem hiding this 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: 10177c6).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112377076
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.
When even constant arrays are left to be handled by the array theory,
expressions such as { 3, 4 }[1] were actually unconstrained as we never
recorded the fact that this expression evaluates to 4. To reduce the
number of constraints to be generated for non-constant indices, ranges
of equal values just yield a single constraint, optimising the case of
large zero-initialised arrays.