-
Notifications
You must be signed in to change notification settings - Fork 5
Lower Bounds Inference #718
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
c207954
to
cd5d4ca
Compare
…ray bounds inference and rewriter.
d0e99cc
to
e474df6
Compare
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
This could cause a compile error if the rest of the function assumed the variable could be used at the solved checked type of the internal PVConstraint. This forced me to factor out the duplicate code related to supplementary decls from DeclRewriter::build{Itype,Checked}Decl as I had proposed.
I've added |
…into range_bounds
…' into range_bounds
lines aren't inserted
…ge bounds Range bounds should be used when talking about the `bounds(lb, up)` bounds expression. When talking about inserting new lower bounds into the source code, use "fresh lower bound".
Lower bounds inference was not functioning properly when a function declaration containing a paramter that was rewriten using a fresh lower bound was coppied into the working directory at the start of phase two. The paramter apears in the header with a count bound, but the fresh lower bound does not appear in the function body because the source file hasn't been coppied yet. This is a hack. A better solution for this problem should be found.
This pull requests extends array bounds inference to support inferring lower bounds for array pointers and inserting using Checked C range bounds.
For example:
3C can now infer bounds for
b
even though a standard count bound would be invalidated by the incrementb++
.These bounds are supported even when there is no existing pointer that can be used the as lower bound.
For example:
3C will generate a fresh lower bound pointer for
a
, so that it can use the heuristically inferred length.Actions Run
The failures on libarchive, libtiff, and lua are expected. The lua failure should be fixed; libarchive is a compiler bug; libtiff needs investigation. (libarchive is actually passing on the run, but previous tests have encountered an intermittent core dump caused by uninitialized memory somewhere in the Checked C bounds widening code).