aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow_ref.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-04-23 00:14:02 +0200
committerJosh Matthews <josh@joshmatthews.net>2015-05-05 10:07:34 -0400
commitef8edd4e87aeb3cc71dfd9da2f69437080f5410e (patch)
tree9146cdd7126ead59c57cacbaa04eda0f16761f65 /components/layout/flow_ref.rs
parent7b87085c1880c60aa3be5b3ec4572a0d93fd5537 (diff)
downloadservo-ef8edd4e87aeb3cc71dfd9da2f69437080f5410e.tar.gz
servo-ef8edd4e87aeb3cc71dfd9da2f69437080f5410e.zip
Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.
Diffstat (limited to 'components/layout/flow_ref.rs')
-rw-r--r--components/layout/flow_ref.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs
index 9a8e2bb580e..6b323c15f6f 100644
--- a/components/layout/flow_ref.rs
+++ b/components/layout/flow_ref.rs
@@ -78,7 +78,8 @@ impl DerefMut for FlowRef {
impl Drop for FlowRef {
fn drop(&mut self) {
unsafe {
- if self.object.vtable.is_null() {
+ if self.object.vtable.is_null() ||
+ self.object.vtable as usize == mem::POST_DROP_USIZE {
return
}
if flow::base(&**self).strong_ref_count().fetch_sub(1, Ordering::Release) != 1 {
@@ -102,7 +103,7 @@ impl Drop for FlowRef {
let object_align = vtable[2];
let fake_data = heap::allocate(object_size, object_align);
- ptr::copy(fake_data, flow_ref.object.data as *const u8, object_size);
+ ptr::copy(flow_ref.object.data as *const u8, fake_data, object_size);
let fake_box = raw::TraitObject { vtable: flow_ref.object.vtable, data: fake_data as *mut () };
let fake_flow = mem::transmute::<raw::TraitObject, Box<Flow>>(fake_box);
@@ -181,7 +182,8 @@ impl Clone for WeakFlowRef {
impl Drop for WeakFlowRef {
fn drop(&mut self) {
unsafe {
- if self.object.vtable.is_null() {
+ if self.object.vtable.is_null() ||
+ self.object.vtable as usize == mem::POST_DROP_USIZE {
return
}