Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upfrom_elem is unsound when clone can panic #101
Comments
mbrubeck
added
the
bug
label
Jun 14, 2018
added a commit
to mbrubeck/rust-smallvec
that referenced
this issue
Jul 18, 2018
mbrubeck
self-assigned this
Jul 18, 2018
added a commit
to mbrubeck/rust-smallvec
that referenced
this issue
Jul 18, 2018
added a commit
that referenced
this issue
Jul 19, 2018
bors-servo
closed this
in
#103
Jul 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mbrubeck commentedJun 14, 2018
If
clonepanics duringSmallVec::from_elemthen uninitialized memory is dropped. [Original report by dbaupp on Reddit.]This bug was introduced by #93 which is not yet included in the latest published release (0.6.2).
The suggested solution is to use something like
SetLenOnDropto make sure the length is set correctly when destructors run, without inhibiting optimizations.