Skip to content

Pointer arithmetic check: do not use pointer-to-int conversion #5849

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 22, 2021

Conversation

tautschnig
Copy link
Collaborator

We do not currently have a sound pointer-to-int conversion, and thus
arithmetic involving pointers and integers does not translate to
arithmetic over the integer representation of a pointer.

With the recently added bounds checks on pointers involved in arithmetic
we have a more reliable way of testing for overflow in pointer
arithmetic.

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

We do not currently have a sound pointer-to-int conversion, and thus
arithmetic involving pointers and integers does not translate to
arithmetic over the integer representation of a pointer.

With the recently added bounds checks on pointers involved in arithmetic
we have a more reliable way of testing for overflow in pointer
arithmetic.
@tautschnig tautschnig added bugfix aws Bugs or features of importance to AWS CBMC users labels Feb 19, 2021
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #5849 (4d7158f) into develop (3acdb52) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5849   +/-   ##
========================================
  Coverage    72.87%   72.87%           
========================================
  Files         1421     1421           
  Lines       154181   154208   +27     
========================================
+ Hits        112359   112386   +27     
  Misses       41822    41822           
Impacted Files Coverage Δ
src/analyses/goto_check.cpp 88.25% <100.00%> (+0.04%) ⬆️
src/solvers/flattening/bv_pointers.cpp 84.93% <100.00%> (+0.69%) ⬆️
src/solvers/flattening/bv_utils.h 85.71% <0.00%> (+1.09%) ⬆️

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 4bbd1c9...49481e2. Read the comment docs.

@@ -1177,22 +1177,6 @@ void goto_checkt::pointer_overflow_check(
expr.operands().size() == 2,
"pointer arithmetic expected to have exactly 2 operands");

// check for address space overflow by checking for overflow on integers
Copy link
Collaborator

Choose a reason for hiding this comment

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

😬

@tautschnig tautschnig merged commit 743c2d1 into diffblue:develop Feb 22, 2021
@tautschnig tautschnig deleted the fix-getenv branch February 22, 2021 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants