Skip to content

Perform pointer validity checks when doing pointer arithmetic #5844

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 1 commit into from
Feb 19, 2021

Conversation

tautschnig
Copy link
Collaborator

Arithmetic over pointers requires that they point to valid objects (or
one past the end of an object).

The test uncovered two further problems: 1) there was a typo in
subtraction handling in bv_pointerst; 2) redundant assertions are
removed, even when they refer to different expressions.

Fixes: #5426

  • 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.
  • 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).
  • 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.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems pretty good.

Arithmetic over pointers requires that they point to valid objects (or
one past the end of an object).

The test uncovered two further problems: 1) there was a typo in
subtraction handling in bv_pointerst; 2) redundant assertions are
removed, even when they refer to different expressions.

Fixes: diffblue#5426
@tautschnig tautschnig force-pushed the pointer-overflow-check branch from 4a31d62 to 3acdb52 Compare February 19, 2021 18:15
@tautschnig tautschnig self-assigned this Feb 19, 2021
@codecov
Copy link

codecov bot commented Feb 19, 2021

Codecov Report

Merging #5844 (3acdb52) into develop (dbbe1da) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5844      +/-   ##
===========================================
+ Coverage    72.86%   72.87%   +0.01%     
===========================================
  Files         1421     1421              
  Lines       154173   154181       +8     
===========================================
+ Hits        112337   112359      +22     
+ Misses       41836    41822      -14     
Impacted Files Coverage Δ
src/analyses/goto_check.cpp 88.21% <100.00%> (+0.09%) ⬆️
src/solvers/flattening/bv_pointers.cpp 84.24% <100.00%> (+3.06%) ⬆️

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 751c986...3acdb52. Read the comment docs.

@tautschnig tautschnig merged commit 4bbd1c9 into diffblue:develop Feb 19, 2021
@tautschnig tautschnig deleted the pointer-overflow-check branch February 19, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing results with --pointer-overflow-check
2 participants