Mercurial > emacs
diff src/composite.c @ 98213:52d26067a946
(Fcomposition_get_gstring): Yet another int/Lisp_Oject mixup (YAILOM).
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 17 Sep 2008 21:25:29 +0000 |
parents | b5e444f66902 |
children | 5803b1114219 |
line wrap: on
line diff
--- a/src/composite.c Wed Sep 17 20:34:16 2008 +0000 +++ b/src/composite.c Wed Sep 17 21:25:29 2008 +0000 @@ -1489,6 +1489,7 @@ Lisp_Object font_object, from, to, string; { Lisp_Object gstring, header; + EMACS_INT frompos, topos; if (! NILP (font_object)) CHECK_FONT_OBJECT (font_object); @@ -1496,8 +1497,13 @@ gstring = gstring_lookup_cache (header); if (! NILP (gstring)) return gstring; - if (LGSTRING_GLYPH_LEN (gstring_work) < to - from) - gstring_work = Fmake_vector (make_number (to - from + 2), Qnil); + + /* Maybe we should check this at the function's entry. --Stef */ + CHECK_NATNUM (from); frompos = XINT (from); + CHECK_NATNUM (to); topos = XINT (to); + + if (LGSTRING_GLYPH_LEN (gstring_work) < topos - frompos) + gstring_work = Fmake_vector (make_number (topos - frompos + 2), Qnil); LGSTRING_SET_HEADER (gstring_work, header); LGSTRING_SET_ID (gstring_work, Qnil); fill_gstring_body (gstring_work);