Skip to content

CONTRACTS: Allow void function calls in assigns clauses #7214

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

Conversation

remi-delmas-3000
Copy link
Collaborator

This is a front-end modification required for #6887. It allows to call user-defined functions returning void in
assigns clauses.
Accepted by the front end but triggers an error in the back end if actually used (for now).
Will be documented when supported.

  • Each commit message has a non-empty body, explaining why the change was made.
  • 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).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Front-end modification that prepares for dynamic frames.
@jimgrundy
Copy link
Collaborator

@nwetzler, can you review the front-end changes.

@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Base: 77.89% // Head: 77.88% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (8601666) compared to base (7f86707).
Patch coverage: 81.81% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7214      +/-   ##
===========================================
- Coverage    77.89%   77.88%   -0.01%     
===========================================
  Files         1616     1616              
  Lines       186701   186719      +18     
===========================================
+ Hits        145433   145435       +2     
- Misses       41268    41284      +16     
Impacted Files Coverage Δ
src/ansi-c/c_typecheck_code.cpp 77.72% <80.00%> (-0.04%) ⬇️
...o-instrument/contracts/instrument_spec_assigns.cpp 99.38% <100.00%> (+0.61%) ⬆️
src/cprover/console.cpp 31.25% <0.00%> (-1.22%) ⬇️
src/cprover/help_formatter.h 0.00% <0.00%> (ø)
src/cprover/help_formatter.cpp 0.00% <0.00%> (ø)
src/goto-analyzer/static_simplifier.cpp 87.65% <0.00%> (+0.31%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users aws-high labels Oct 6, 2022
@feliperodri feliperodri changed the title CONTRACTS: allow void function calls in assigns clauses CONTRACTS: Allow void function calls in assigns clauses Oct 6, 2022
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.

Only minor comments.

Comment on lines +1000 to +1002
throw invalid_source_file_exceptiont(
"function pointer calls not allowed in assigns clauses",
target.source_location());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we add a regression test to cover this case?

Comment on lines +1022 to +1023
"to " CPROVER_PREFIX
"POINTER_OBJECT or a call to a function returning void",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to remove here all CPROVER_PREFIX_object_* cases? Make the error message shorter? For me, it was quite informative before.

@feliperodri feliperodri added the Code Contracts Function and loop contracts label Oct 6, 2022
@nwetzler nwetzler self-requested a review October 6, 2022 21: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 aws-high blocker Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants