1
Fork 0

recursively drop Box<Box<...Box<T>...>>

This commit is contained in:
Oliver Schneider 2016-11-03 13:30:54 +01:00
parent a1acd9405d
commit feefb66ebd
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46

View file

@ -478,9 +478,9 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
// TODO(solson): Call user-defined Drop::drop impls.
match ty.sty {
ty::TyBox(_contents_ty) => {
ty::TyBox(contents_ty) => {
let contents_ptr = val.read_ptr(&self.memory)?;
// self.drop(contents_ptr, contents_ty)?;
self.drop(Value::ByRef(contents_ptr), contents_ty)?;
trace!("-deallocating box");
self.memory.deallocate(contents_ptr)?;
}