Skip to content

Enable typechecking of shadow memory primitives #7909

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

Conversation

esteffin
Copy link
Contributor

@esteffin esteffin commented Sep 20, 2023

This PR enables typechecking of shadow memory primitives.

The primitives are checked for correct number of arguments, correct types and also enforce other invariants such as having a constant string for name, a bit-vector type of size < 8 and non-void pointers for accessing it.

It also adds regressions and unit tests for it.

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

@esteffin esteffin requested a review from a team September 20, 2023 17:00
@esteffin esteffin force-pushed the esteffin/define-shadow-memory-primitives branch 3 times, most recently from ce7b861 to 4f49ea5 Compare September 20, 2023 17:30
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

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

Comparison is base (10c4bca) 78.91% compared to head (b7ebd34) 78.94%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7909      +/-   ##
===========================================
+ Coverage    78.91%   78.94%   +0.03%     
===========================================
  Files         1697     1699       +2     
  Lines       195418   195804     +386     
===========================================
+ Hits        154211   154578     +367     
- Misses       41207    41226      +19     
Files Coverage Δ
src/ansi-c/c_typecheck_base.h 100.00% <ø> (ø)
src/ansi-c/c_typecheck_expr.cpp 77.23% <100.00%> (+0.13%) ⬆️
src/ansi-c/c_typecheck_shadow_memory_builtin.cpp 100.00% <100.00%> (ø)
unit/ansi-c/c_typecheck_base.cpp 99.18% <99.18%> (ø)

... and 16 files with indirect coverage changes

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

assert(__CPROVER_get_field(&s.j, "uninitialized") == 1);

return 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

newline at the end (several occurrences)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@esteffin esteffin force-pushed the esteffin/define-shadow-memory-primitives branch 3 times, most recently from 63334e8 to 266114e Compare September 27, 2023 09:57
@esteffin esteffin force-pushed the esteffin/define-shadow-memory-primitives branch from 266114e to 31577ab Compare September 27, 2023 13:32
@esteffin esteffin enabled auto-merge September 27, 2023 13:33
Enrico Steffinlongo and others added 4 commits September 27, 2023 14:42
Adding typecheck code for shadow memory builtins so they are
type-checked (more thoroughly than with the C typechecker) and
correctly converted to function calls.
Fixed SM failing regression tests due to better error messaging on
typecheck.
@esteffin esteffin force-pushed the esteffin/define-shadow-memory-primitives branch from 31577ab to b7ebd34 Compare September 27, 2023 13:42
@esteffin esteffin merged commit c19a933 into diffblue:develop Sep 27, 2023
@esteffin esteffin deleted the esteffin/define-shadow-memory-primitives branch September 27, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants