Skip to content

Commit

Permalink
Regression(270013@main): Crash when loading bgtime.tv
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264132
<rdar://117882210>

Reviewed by Brent Fulgham.

270013@main updated `GlyphPage::m_font` to be a CheckedPtr. However, the
assertion is the CanMakeCheckedPtrBase destructor is hitting when loading
bgtime.tv. As a result, I am downgrading to a simple WeakPtr to address
the crash.

* Source/WebCore/platform/graphics/GlyphPage.h:
(WebCore::GlyphPage::glyphDataForIndex const):
(WebCore::GlyphPage::font const):

Canonical link: https://commits.webkit.org/270190@main
  • Loading branch information
cdumez committed Nov 3, 2023
1 parent 58eff34 commit 1f9b906
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebCore/platform/graphics/GlyphPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class GlyphPage : public RefCounted<GlyphPage> {
{
Glyph glyph = glyphForIndex(index);
auto colorGlyphType = colorGlyphTypeForIndex(index);
return GlyphData(glyph, glyph ? m_font.ptr() : nullptr, colorGlyphType);
return GlyphData(glyph, glyph ? m_font.get() : nullptr, colorGlyphType);
}

Glyph glyphForIndex(unsigned index) const
Expand All @@ -122,7 +122,7 @@ class GlyphPage : public RefCounted<GlyphPage> {

const Font& font() const
{
return m_font.get();
return *m_font;
}

// Implemented by the platform.
Expand All @@ -135,7 +135,7 @@ class GlyphPage : public RefCounted<GlyphPage> {
++s_count;
}

CheckedRef<const Font> m_font;
WeakPtr<const Font> m_font;
Glyph m_glyphs[size] { };
WTF::BitSet<size> m_isColor;

Expand Down

0 comments on commit 1f9b906

Please sign in to comment.