Skip to content

Simplification of pointer comparison: do not assume numeric types #5689

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
Dec 25, 2020

Conversation

tautschnig
Copy link
Collaborator

As we cannot (or chose not to) catch all type inconsistencies in the
language front-end, we may pass expressions to simplification that do
not adhere to typing expectations. The included example is such a case,
where the missing declaration of memcpy makes the struct-to-pointer
cast get all the way to the middle end.

Test is based on a sample generated by C-Reduce when starting from an
SV-COMP task.

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

As we cannot (or chose not to) catch all type inconsistencies in the
language front-end, we may pass expressions to simplification that do
not adhere to typing expectations. The included example is such a case,
where the missing declaration of `memcpy` makes the struct-to-pointer
cast get all the way to the middle end.

Test is based on a sample generated by C-Reduce when starting from an
SV-COMP task.
@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #5689 (a353fbb) into develop (95097a8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5689   +/-   ##
========================================
  Coverage    69.49%   69.50%           
========================================
  Files         1243     1243           
  Lines       100674   100674           
========================================
+ Hits         69962    69972   +10     
+ Misses       30712    30702   -10     
Flag Coverage Δ
cproversmt2 43.10% <80.00%> (-0.01%) ⬇️
regression 66.39% <100.00%> (+<0.01%) ⬆️
unit 32.26% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/util/simplify_expr_int.cpp 80.08% <100.00%> (ø)
src/goto-symex/symex_function_call.cpp 94.48% <0.00%> (+6.89%) ⬆️

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 95097a8...a353fbb. Read the comment docs.

main.c

function 'memcpy' is not declared
parameter "memcpy::dst" type mismatch
Copy link
Member

Choose a reason for hiding this comment

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

⛏️ mixture of " and '

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems there's some more work after #4875 left to be done. I'll create a separate PR for this.

@tautschnig tautschnig merged commit 0af9689 into diffblue:develop Dec 25, 2020
@tautschnig tautschnig deleted the pointer-simpl branch December 25, 2020 11:20
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.

2 participants