diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs index 297599e2080..b0c8750265b 100644 --- a/components/style/gecko_string_cache/mod.rs +++ b/components/style/gecko_string_cache/mod.rs @@ -122,7 +122,8 @@ impl WeakAtom { unsafe { u8_ptr.offset(string_offset) as *const u16 } } else { let atom_ptr = self.as_ptr() as *const nsDynamicAtom; - unsafe { (*(atom_ptr)).mString } + // Dynamic atom chars are stored at the end of the object. + unsafe { atom_ptr.offset(1) as *const u16 } }; unsafe { slice::from_raw_parts(string, self.len() as usize) } }