Skip to content

Variables leaving scope on jumping should always be marked dead #8092

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

thomasspriggs
Copy link
Contributor

This PR ensures that variables leaving scope on jumping are always marked as dead. Even if new variables would be introduced to the scope, the existing variables which go out of scope still need to be marked as dead and/or have their destructors called. This was discovered during investigation for issue #7997 . The issue fixed in this PR should be fixed in order to ensure that variable lifetimes are handled correctly. It has been split from the work to fix the linked issue as it is not required for the example outlined in that issue.

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

Even if new variables would be introduced to the scope, the existing
variables which go out of scope still need to be marked as dead and/or
have their destructors called.

The placeholder for construction is moved to after the destruction, as
destructions should be done first.
Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9795ca6) 79.07% compared to head (2b8a8fc) 79.07%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8092   +/-   ##
========================================
  Coverage    79.07%   79.07%           
========================================
  Files         1698     1698           
  Lines       196463   196463           
========================================
  Hits        155346   155346           
  Misses       41117    41117           

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

@tautschnig
Copy link
Collaborator

The CSmith test failure is safe to ignore.

@thomasspriggs thomasspriggs merged commit 42225bc into diffblue:develop Dec 5, 2023
@thomasspriggs thomasspriggs deleted the tas/always_add_destructors branch December 5, 2023 14:13
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.

4 participants