Skip to content
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

Code contracts: do not interleave checking and instrumenting #8095

Merged

Conversation

tautschnig
Copy link
Collaborator

Loop normalisation must first check that all loops described via natural_loopst are of the expected shape and then start inserting or transforming instructions. Else, and depending on loop shapes and loop nesting, the instruction iterators held in the natural_loopst may no longer be adequate descriptions of the loops. (The iterators weren't invalidated, but would no longer point to heads or loop ends.)

  • 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

codecov bot commented Dec 5, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (79fafbe) 79.69% compared to head (e2e3e0e) 79.69%.

Files Patch % Lines
src/goto-instrument/contracts/contracts.cpp 65.21% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8095      +/-   ##
===========================================
- Coverage    79.69%   79.69%   -0.01%     
===========================================
  Files         1680     1680              
  Lines       195167   195195      +28     
===========================================
+ Hits        155544   155564      +20     
- Misses       39623    39631       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tautschnig tautschnig force-pushed the bugfixes/contracts-loop-normalisation branch from 649dbb3 to c9c23be Compare January 12, 2024 14:18
@tautschnig tautschnig self-assigned this Jan 15, 2024
Copy link
Collaborator

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

LGTM (apart from the CI failures).

Maintain goto-program invariants when modifying a program via
function-pointer restrictions.
@tautschnig tautschnig force-pushed the bugfixes/contracts-loop-normalisation branch from c9c23be to 98f41b0 Compare January 23, 2024 11:52
Loop normalisation must first check that all loops described via
`natural_loopst` are of the expected shape and then start inserting or
transforming instructions. Else, and depending on loop shapes and loop
nesting, the instruction iterators held in the `natural_loopst` may no
longer be adequate descriptions of the loops. (The iterators weren't
invalidated, but would no longer point to heads or loop ends.)
This is to use standard terminology.
@tautschnig tautschnig force-pushed the bugfixes/contracts-loop-normalisation branch from 98f41b0 to e2e3e0e Compare January 23, 2024 11:56
@tautschnig tautschnig merged commit 19fc213 into diffblue:develop Jan 23, 2024
38 of 39 checks passed
@tautschnig tautschnig deleted the bugfixes/contracts-loop-normalisation branch January 23, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants