1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00

Fix coding.c subscript error

* coding.c (CODING_ISO_INVOKED_CHARSET):
Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
This commit is contained in:
Paul Eggert 2015-01-21 00:29:02 -08:00
parent 3ea1b31f46
commit 88ba49fe35
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2015-01-21 Paul Eggert <eggert@cs.ucla.edu>
Fix coding.c subscript error
* coding.c (CODING_ISO_INVOKED_CHARSET):
Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
Backport: correct old fix for GTK font selection
* gtkutil.c (xg_get_font): Fix off-by-2 typo.
Fixes: bug#3228

View File

@ -395,7 +395,8 @@ static Lisp_Object Vbig5_coding_system;
#define CODING_ISO_BOL(coding) \
((coding)->spec.iso_2022.bol)
#define CODING_ISO_INVOKED_CHARSET(coding, plane) \
CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane)))
(CODING_ISO_INVOCATION (coding, plane) < 0 ? -1 \
: CODING_ISO_DESIGNATION (coding, CODING_ISO_INVOCATION (coding, plane)))
#define CODING_ISO_CMP_STATUS(coding) \
(&(coding)->spec.iso_2022.cmp_status)
#define CODING_ISO_EXTSEGMENT_LEN(coding) \