emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash with --enable-checking and some glyphs


From: Lars Ingebrigtsen
Subject: Re: Crash with --enable-checking and some glyphs
Date: Sat, 27 Nov 2021 15:04:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> But what about the font?  We don't use the above for it->descent, at
> least not directly.  So where in the code did it->descent get
> negative?

(gdb) p font->descent
$14 = 2
(gdb) print boff
$15 = 3

I think it has to be from here:

      if (it->char_to_display != '\n' && it->char_to_display != '\t')
        {
          it->nglyphs = 1;

          if (it->override_ascent >= 0)
            {
              it->ascent = it->override_ascent;
              it->descent = it->override_descent;
              boff = it->override_boff;
            }
          else
            {
              it->ascent = FONT_BASE (font) + boff;
              it->descent = FONT_DESCENT (font) - boff;
            }

And boff is 3 because of:

      boff = font->baseline_offset;
      if (font->vertical_centering)
        boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;

(gdb) print font->vertical_centering 
$17 = true


And we don't apply these sanity checks in this case:

                      /* These limitations are enforced by an
                         assertion near the end of this function.  */
                      if (it->ascent < 0)
                        it->ascent = 0;
                      if (it->descent < 0)
                        it->descent = 0;


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]