Skip to content

GOTO programs do not have code-typed struct members #6892

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 4 commits into from
Nov 11, 2022

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented May 27, 2022

It's only the C++ front-end that puts methods in struct members, and
this should not leak into GOTO programs. We can, therefore, clean up a
number of unnecessary branches.

Please review commit-by-commit.

Fixes #6984.

  • 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.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Base: 78.02% // Head: 78.04% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (4c8e44b) compared to base (b19b412).
Patch coverage: 85.34% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6892      +/-   ##
===========================================
+ Coverage    78.02%   78.04%   +0.02%     
===========================================
  Files         1625     1624       -1     
  Lines       187427   187404      -23     
===========================================
+ Hits        146231   146253      +22     
+ Misses       41196    41151      -45     
Impacted Files Coverage Δ
src/cprover/cprover_parse_options.cpp 56.58% <ø> (ø)
src/cprover/generalization.cpp 84.21% <ø> (ø)
src/cprover/inductiveness.cpp 78.35% <ø> (ø)
src/cprover/propagate.cpp 74.28% <ø> (ø)
src/cprover/report_properties.cpp 88.46% <ø> (ø)
src/cprover/report_traces.cpp 89.74% <ø> (ø)
src/cprover/solver.cpp 92.00% <ø> (ø)
src/cprover/solver_progress.cpp 60.00% <ø> (ø)
src/goto-programs/graphml_witness.cpp 52.94% <0.00%> (-0.15%) ⬇️
src/goto-programs/interpreter.cpp 52.38% <0.00%> (+0.17%) ⬆️
... and 23 more

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.

first = false;
else
{
if(last_size + 40 < dest.size())
Copy link
Contributor

Choose a reason for hiding this comment

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

Magic constant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's the same constant (and approach) that expr2ct::convert_struct uses for pretty-printing (and the same is true for arrays). Could be replaced by a named constant, but I'll just create an issue for the readability of this code needs improvement: #6900.

@danielsn
Copy link
Contributor

danielsn commented Jun 2, 2022

FYI: Looks like Kani also creates Code type struct elements. We are working on fixing this. model-checking/kani#1243

Cleanup of an unnecessary branch: Any such component would be a
pointer/reference, not an actual code-typed element.
Whitespace changes only, no change in behaviour.
Cleanup of unnecessary branches: Any such component would be a function
pointer, not an actual code-typed element.
It's only the C++ front-end that puts methods in struct members, and
this should not leak into GOTO programs. We can, therefore, clean up a
number of unnecessary branches.

Fixes: diffblue#6984
@jimgrundy
Copy link
Collaborator

What's the blocking issue here? Are we just waiting on a code review?

@tautschnig tautschnig requested a review from nwetzler November 4, 2022 22:09
@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users Kani Bugs or features of importance to Kani Rust Verifier labels Nov 9, 2022
@tautschnig tautschnig merged commit 0060417 into diffblue:develop Nov 11, 2022
@tautschnig tautschnig deleted the cleanup/no-code branch November 11, 2022 08:57
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 cleanup Kani Bugs or features of importance to Kani Rust Verifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CBMC silently omits invalid struct field in GotoC output
8 participants