Skip to content

GOTO conversion: Declaration hops must not invalidate incomplete gotos #8349

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
Jun 19, 2024

Conversation

tautschnig
Copy link
Collaborator

Declaration hops are built as part of finish_gotos, and must not invalidate goto-instructions that are yet to be finished. To accomplish this, collect all instructions that are to be inserted and do the insertion after having finished all gotos.

Bug was observed when invoking CBMC from Kani.

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

Declaration hops are built as part of finish_gotos, and must not
invalidate goto-instructions that are yet to be finished. To accomplish
this, collect all instructions that are to be inserted and do the
insertion after having finished all gotos.

Bug was observed when invoking CBMC from Kani.
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.12%. Comparing base (50bfa4e) to head (fd6c193).
Report is 4 commits behind head on develop.

Files Patch % Lines
src/ansi-c/goto-conversion/goto_convert.cpp 85.71% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8349      +/-   ##
===========================================
- Coverage    78.15%   78.12%   -0.04%     
===========================================
  Files         1726     1726              
  Lines       188862   188967     +105     
  Branches     18403    18435      +32     
===========================================
+ Hits        147613   147622       +9     
- Misses       41249    41345      +96     

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

Copy link
Member

@peterschrammel peterschrammel left a comment

Choose a reason for hiding this comment

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

Any test that triggered this?

@tautschnig
Copy link
Collaborator Author

Any test that triggered this?

I'm having a hard time come up with a C code example that does this. Kani (well, really, MIR) appears to have loads of these.

@tautschnig tautschnig merged commit 2ffc4c9 into diffblue:develop Jun 19, 2024
39 of 40 checks passed
@tautschnig tautschnig deleted the fix-goto-crossing-scopes branch June 19, 2024 17:30
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.

3 participants