mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Harden assert for creating atom from raw pointer.
This commit is contained in:
parent
473934c989
commit
4f6752ed1a
1 changed files with 2 additions and 2 deletions
|
@ -265,7 +265,7 @@ impl Atom {
|
||||||
/// called on it.
|
/// called on it.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn from_addrefed(ptr: *mut nsIAtom) -> Self {
|
pub unsafe fn from_addrefed(ptr: *mut nsIAtom) -> Self {
|
||||||
debug_assert!(!ptr.is_null());
|
assert!(!ptr.is_null());
|
||||||
unsafe {
|
unsafe {
|
||||||
Atom(WeakAtom::new(ptr))
|
Atom(WeakAtom::new(ptr))
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ impl From<String> for Atom {
|
||||||
impl From<*mut nsIAtom> for Atom {
|
impl From<*mut nsIAtom> for Atom {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn from(ptr: *mut nsIAtom) -> Atom {
|
fn from(ptr: *mut nsIAtom) -> Atom {
|
||||||
debug_assert!(!ptr.is_null());
|
assert!(!ptr.is_null());
|
||||||
unsafe {
|
unsafe {
|
||||||
let ret = Atom(WeakAtom::new(ptr));
|
let ret = Atom(WeakAtom::new(ptr));
|
||||||
if !ret.is_static() {
|
if !ret.is_static() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue