diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-11-18 17:33:22 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-11-20 14:13:18 +0100 |
commit | 5c98dffea6cbacfb7c3e1f944fa0dda93e354ccf (patch) | |
tree | 7bad075710db221a4588fa2a345f39998b52461e /components | |
parent | 72e4c6dc21c132d49cf0a5f68a3ba45d16cc8322 (diff) | |
download | servo-5c98dffea6cbacfb7c3e1f944fa0dda93e354ccf.tar.gz servo-5c98dffea6cbacfb7c3e1f944fa0dda93e354ccf.zip |
style: Don't assert when the final rule tree GC happens in script.
Diffstat (limited to 'components')
-rw-r--r-- | components/style/rule_tree/mod.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 394e1f88d60..2e87a30c212 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -427,15 +427,23 @@ impl StrongRuleNode { } unsafe fn pop_from_free_list(&self) -> Option<WeakRuleNode> { - debug_assert!(thread_state::get().is_layout() && - !thread_state::get().is_worker()); - // NB: This can run from the root node destructor, so we can't use // `get()`, since it asserts the refcount is bigger than zero. let me = &*self.ptr; + debug_assert!(me.is_root()); + // FIXME(#14213): Apparently the layout data can be gone from script. + // + // That's... suspicious, but it's fine if it happens for the rule tree + // case, so just don't crash in the case we're doing the final GC in + // script. + debug_assert!(!thread_state::get().is_worker() && + (thread_state::get().is_layout() || + (thread_state::get().is_script() && + me.refcount.load(Ordering::SeqCst) == 0))); let current = me.next_free.load(Ordering::SeqCst); + if current == FREE_LIST_SENTINEL { return None; } |