diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-09-18 11:30:45 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-01-27 16:37:08 +0100 |
commit | 357463864b573b989486616be92f6b2bd587349f (patch) | |
tree | c85397cc5c5d5590e9bdf21b65bf97cd4ce244a0 /components/layout/layout_thread.rs | |
parent | 03b763c2c5b873ccc454278a55737bc37e940e97 (diff) | |
download | servo-357463864b573b989486616be92f6b2bd587349f.tar.gz servo-357463864b573b989486616be92f6b2bd587349f.zip |
Avoid a transmute that relied on undefined struct layout.
Diffstat (limited to 'components/layout/layout_thread.rs')
-rw-r--r-- | components/layout/layout_thread.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 6f28c18ee9c..206bfe4c82d 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -55,7 +55,6 @@ use std::borrow::ToOwned; use std::cell::RefCell; use std::collections::HashMap; use std::collections::hash_state::DefaultState; -use std::mem::transmute; use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{channel, Sender, Receiver}; @@ -1313,7 +1312,8 @@ impl LayoutThread { /// Handles a message to destroy layout data. Layout data must be destroyed on *this* thread /// because the struct type is transmuted to a different type on the script side. unsafe fn handle_reap_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData) { - let non_opaque: NonOpaqueStyleAndLayoutData = transmute(data.ptr); + let ptr: *mut () = *data.ptr; + let non_opaque: NonOpaqueStyleAndLayoutData = ptr as *mut _; let _ = Box::from_raw(non_opaque); } |