From d459e3453ae309302537a4c9937336a14f632e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 8 Jan 2020 00:55:18 +0000 Subject: [PATCH] style: Make an assertion a release assert in nightly. If this can happen legitimately, this will help fuzzers to catch it. Differential Revision: https://phabricator.services.mozilla.com/D59066 --- components/style/rule_tree/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 19e3accb851..fa859d79f06 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -1719,7 +1719,10 @@ impl Drop for StrongRuleNode { return; } - debug_assert!(node.children.read().is_empty()); + if cfg!(debug_assertions) || crate::gecko_bindings::structs::GECKO_IS_NIGHTLY { + assert!(node.children.read().is_empty()); + } + if node.parent.is_none() { debug!("Dropping root node!"); // The free list should be null by this point