emacs-devel
[Top][All Lists]
Advanced

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

LGLYPH_SET_CODE


From: Eli Zaretskii
Subject: LGLYPH_SET_CODE
Date: Fri, 29 Aug 2008 11:44:58 +0300

Can the second argument to this macro be negative?  If so, the current
definition:

    #define LGLYPH_SET_CODE(g, val)                                     \
      do {                                                              \
        if (val == FONT_INVALID_CODE)                                   \
          ASET ((g), LGLYPH_IX_CODE, Qnil);                             \
        else if ((EMACS_INT)val > MOST_POSITIVE_FIXNUM)                 \
          ASET ((g), LGLYPH_IX_CODE, Fcons (make_number ((val) >> 16),  \
                                            make_number ((val) & 0xFFFF)));\
        else                                                            \
          ASET ((g), LGLYPH_IX_CODE, make_number (val));                \
      } while (0)

does not handle such values correctly, because their absolute value
could be large enough to overflow an EMACS_INT.  If negative values
are possible, we should use FIXNUM_OVERFLOW_P instead of a comparison
with MOST_POSITIVE_FIXNUM.





reply via email to

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