Skip to content

Make pointer-primitive-check a no-op when behaviour is always defined #6491

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

@tautschnig tautschnig commented Nov 30, 2021

pointer_object, pointer_offset have
well-defined behaviour even when the input is an unconstrained pointer:
the result is equally unconstrained.

Regression tests are updated to reflect the reduced number of checks
generated by --pointer-primitive-check. Note that
the patterns in pointer-primitive-check-03 never were effective as they
were placed in the patterns-not-to-seen section of test.desc while also
missing proper parenthesis escaping (making the patterns trivially
non-matching).

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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).
  • 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.

@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #6491 (be35b6c) into develop (637704f) will increase coverage by 0.00%.
The diff coverage is 61.05%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6491   +/-   ##
========================================
  Coverage    76.09%   76.09%           
========================================
  Files         1548     1548           
  Lines       166328   166327    -1     
========================================
+ Hits        126563   126568    +5     
+ Misses       39765    39759    -6     
Impacted Files Coverage Δ
src/analyses/goto_check_java.cpp 31.47% <49.31%> (ø)
src/analyses/goto_check_c.cpp 90.28% <100.00%> (-0.01%) ⬇️
src/goto-instrument/contracts/contracts.cpp 95.52% <100.00%> (ø)
src/util/ieee_float.cpp 88.01% <0.00%> (+0.16%) ⬆️
src/ansi-c/expr2c.cpp 65.82% <0.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ae9bde...be35b6c. Read the comment docs.

@tautschnig tautschnig self-assigned this Dec 1, 2021
@tautschnig tautschnig marked this pull request as draft December 1, 2021 17:19
@tautschnig tautschnig force-pushed the pointer-primitive-check-cleanup branch 2 times, most recently from 1f2a160 to 4a6be48 Compare December 1, 2021 18:50
@tautschnig tautschnig marked this pull request as ready for review December 1, 2021 19:48
@kroening kroening mentioned this pull request Dec 2, 2021
4 tasks
@tautschnig tautschnig force-pushed the pointer-primitive-check-cleanup branch from 4a6be48 to dc12412 Compare December 2, 2021 19:16
pointer_object, pointer_offset have well-defined behaviour even when the
input is an unconstrained pointer: the result is equally unconstrained.

Regression tests are updated to reflect the reduced number of checks
generated by --pointer-primitive-check.

Note that the patterns in pointer-primitive-check-03 never were
effective as they were placed in the patterns-not-to-seen section of
test.desc while also missing proper parenthesis escaping (making the
patterns trivially non-matching).

Fixes: diffblue#6238
@tautschnig tautschnig force-pushed the pointer-primitive-check-cleanup branch from dc12412 to be35b6c Compare December 4, 2021 19:52
@tautschnig tautschnig requested a review from kroening as a code owner December 4, 2021 19:52
- `__CPROVER_same_object`

Using them on invalid pointers, however, may still be unintended in user
programs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is really helpful; thanks for adding it.

@martin-cs
Copy link
Collaborator

Is the patch coverage number correct? If so it would be good to be over the current average.

@tautschnig
Copy link
Collaborator Author

Is the patch coverage number correct? If so it would be good to be over the current average.

Looking at GitHub's annotated diff, nothing in the diff is called out as being uncovered. Also, it would be very much surprising if any C/C++ changes were not covered. Perhaps Codecov measures the coverage against all lines in the diff, including changes to documentation? I wasn't able to figure out from Codecov's documentation how this is computed.

@tautschnig tautschnig merged commit 360c01d into diffblue:develop Dec 7, 2021
@tautschnig tautschnig deleted the pointer-primitive-check-cleanup branch December 7, 2021 21:08
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