From 4f6752ed1a4588b3ff863c5d56cdc7a75a06864e Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 30 Aug 2017 11:24:43 +1000 Subject: [PATCH] Harden assert for creating atom from raw pointer. --- components/style/gecko_string_cache/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs index d8390097016..3844ddc2997 100644 --- a/components/style/gecko_string_cache/mod.rs +++ b/components/style/gecko_string_cache/mod.rs @@ -265,7 +265,7 @@ impl Atom { /// called on it. #[inline] pub unsafe fn from_addrefed(ptr: *mut nsIAtom) -> Self { - debug_assert!(!ptr.is_null()); + assert!(!ptr.is_null()); unsafe { Atom(WeakAtom::new(ptr)) } @@ -378,7 +378,7 @@ impl From for Atom { impl From<*mut nsIAtom> for Atom { #[inline] fn from(ptr: *mut nsIAtom) -> Atom { - debug_assert!(!ptr.is_null()); + assert!(!ptr.is_null()); unsafe { let ret = Atom(WeakAtom::new(ptr)); if !ret.is_static() {