-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't free embedded, unsized slices in their dtor #16838
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
Conversation
LGTM, modulo s/vectors/slices/. EDIT: oops, I didn't realize you were actually handling |
@@ -63,16 +63,11 @@ pub fn make_drop_glue_unboxed<'a>( | |||
|
|||
let len = get_len(bcx, vptr); | |||
let dataptr = get_dataptr(bcx, vptr); | |||
let bcx = if ty::type_needs_drop(tcx, unit_ty) { | |||
if ty::type_needs_drop(tcx, unit_ty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like prior to your merge, the if
statement actually covered the len
and dataptr
vars too. I don't know if that really matters.
if ty::type_needs_drop(tcx, unit_ty) {
let fill = get_fill(bcx, vptr);
let dataptr = get_dataptr(bcx, vptr);
iter_vec_raw(bcx, dataptr, unit_ty, fill, glue::drop_ty)
} else { bcx }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is calling get_fill()
instead of get_len()
. Curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iter_vec_raw was changed to take the length of the vec, not the fill (len*size_of_element) and get_fill was replaced with get_len
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the len and dataptr could/should be inside the if
Thanks to @eddyb for finding the bug. Closes rust-lang#16826 (I hope)
Changed approach, r? |
This failure does not look related, but is worrisome in general. I have very occasionally seen this happen locally (run-pass hanging). I'm going to do a cc @alexcrichton -- have you seen these sorts of hangs before? |
Yes bors has be failing quite a bit "spuriously" recently, I sadly haven't had time to investigate just yet :( |
Don't double free embedded, unsized slices.
Merge/rebase error from DST. Thanks to @eddyb for finding.
Closes #16826 (I hope)
r?