Repository navigation
[Backport releases/v4.35.0] fix: preserve sticky counts in deletion cascades - #15301
Merged
Merged
Conversation
This PR prevents deletion cascades from releasing objects whose reference count has been frozen after over- or underflow. The public decrement path already stops at `LEAN_RC_STICKY_DROP`, but the internal cascade helper `dec` only stopped for persistent objects. Replace that zero test with an unsigned comparison against the drop threshold, which handles persistent and sticky counts together while live thread-shared counts continue to the atomic path. `cascade_dec_guard_eq_never_freed` in `tests/elab/rc_model.lean` checks the new guard exhaustively over every count that can reach this branch. The sticky-count semantics were introduced in #14838, and the reference-count model extended here was completed in #14910. --------- Co-authored-by: Sebastian Ullrich <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]> (cherry picked from commit 8546083)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport 8546083 from #15241.