Skip to content

Deque::make_contiguous: fix unsoundness when the Deque is not full - #695

Open
sgued wants to merge 4 commits into
rust-embedded:mainfrom
sgued:deque-make-contiguous-not-full
Open

sgued wants to merge 4 commits into
rust-embedded:mainfrom
sgued:deque-make-contiguous-not-full

Conversation

@sgued

@sgued sgued commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Closes #694

This PR also improves the UB cases that Droppable can catch.

sgued added 4 commits October 26, 2026 14:26
This commit makes ids monotonous so tests can make sure that values are not
overwritten accidently
Two checks are added:

1. check that `COUNT` never goes below zero.
2. add a flag to check for double free. This check is added
in a `Box` so that all copies of the `Droppable` point to the same
drop flag

This branch has not been deployed

No deployments
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.

Deque::make_contiguous sets a wrong back for a wrapped, non-full deque: len() grows and elements are dropped twice

1 participant