mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Correct the signature of flow_ref::deref_mut.
This also fixes Undefined Behavior in build_display_list_for_subtree.
This commit is contained in:
parent
2e6711aa5f
commit
206d603f53
2 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ pub type WeakFlowRef = Weak<Flow>;
|
|||
/// See https://github.com/servo/servo/issues/6503
|
||||
/// Use Arc::get_mut instead when possible (e.g. on an Arc that was just created).
|
||||
#[allow(unsafe_code)]
|
||||
pub fn deref_mut<'a>(r: &mut FlowRef) -> &'a mut Flow {
|
||||
pub fn deref_mut<'a>(r: &'a mut FlowRef) -> &'a mut Flow {
|
||||
let ptr: *const Flow = &**r;
|
||||
unsafe {
|
||||
&mut *(ptr as *mut Flow)
|
||||
|
|
|
@ -87,7 +87,7 @@ pub fn build_display_list_for_subtree(root: &mut FlowRef,
|
|||
&mut root_stacking_context.children);
|
||||
let mut build_display_list = BuildDisplayList {
|
||||
state: DisplayListBuildState::new(&layout_context,
|
||||
flow::base(&**root).stacking_context_id),
|
||||
flow::base(&*flow_root).stacking_context_id),
|
||||
};
|
||||
build_display_list.traverse(&mut *flow_root);
|
||||
build_display_list.state.items
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue