diff options
| author | Andreas Schwab | 2011-07-26 13:00:23 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2011-07-26 13:00:23 +0200 |
| commit | ea180610badb3df580d68e444f4418dce7929d17 (patch) | |
| tree | 1656d42a484151bb3e2d120295b4af76b3460ad4 /src | |
| parent | 7963fa061a06d3d3c3bd396246fbb17e6aad9f67 (diff) | |
| download | emacs-ea180610badb3df580d68e444f4418dce7929d17.tar.gz emacs-ea180610badb3df580d68e444f4418dce7929d17.zip | |
* fontset.c (fontset_get_font_group): Add proper type checks.
(Bug#9172)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fontset.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 62424f794cf..0587a414acb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-07-26 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * fontset.c (fontset_get_font_group): Add proper type checks. | ||
| 4 | (Bug#9172) | ||
| 5 | |||
| 1 | 2011-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 6 | 2011-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 7 | ||
| 3 | * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS | 8 | * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS |
diff --git a/src/fontset.c b/src/fontset.c index 82e46c74347..c335a5642f9 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -463,7 +463,7 @@ reorder_font_vector (font_group, font) | |||
| 463 | /* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for | 463 | /* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for |
| 464 | character C in FONTSET. If C is -1, return a fallback font-group. | 464 | character C in FONTSET. If C is -1, return a fallback font-group. |
| 465 | If C is not -1, the value may be Qt (FONTSET doesn't have a font | 465 | If C is not -1, the value may be Qt (FONTSET doesn't have a font |
| 466 | for C even in the fallback group, or 0 (a font for C may be found | 466 | for C even in the fallback group), or 0 (a font for C may be found |
| 467 | only in the fallback group). */ | 467 | only in the fallback group). */ |
| 468 | 468 | ||
| 469 | static Lisp_Object | 469 | static Lisp_Object |
| @@ -481,7 +481,9 @@ fontset_get_font_group (Lisp_Object fontset, int c) | |||
| 481 | if (! NILP (font_group)) | 481 | if (! NILP (font_group)) |
| 482 | return font_group; | 482 | return font_group; |
| 483 | base_fontset = FONTSET_BASE (fontset); | 483 | base_fontset = FONTSET_BASE (fontset); |
| 484 | if (c >= 0) | 484 | if (NILP (base_fontset)) |
| 485 | font_group = Qnil; | ||
| 486 | else if (c >= 0) | ||
| 485 | font_group = char_table_ref_and_range (base_fontset, c, &from, &to); | 487 | font_group = char_table_ref_and_range (base_fontset, c, &from, &to); |
| 486 | else | 488 | else |
| 487 | font_group = FONTSET_FALLBACK (base_fontset); | 489 | font_group = FONTSET_FALLBACK (base_fontset); |
| @@ -492,6 +494,8 @@ fontset_get_font_group (Lisp_Object fontset, int c) | |||
| 492 | char_table_set_range (fontset, from, to, font_group); | 494 | char_table_set_range (fontset, from, to, font_group); |
| 493 | return font_group; | 495 | return font_group; |
| 494 | } | 496 | } |
| 497 | if (!VECTORP (font_group)) | ||
| 498 | return font_group; | ||
| 495 | font_group = Fcopy_sequence (font_group); | 499 | font_group = Fcopy_sequence (font_group); |
| 496 | for (i = 0; i < ASIZE (font_group); i++) | 500 | for (i = 0; i < ASIZE (font_group); i++) |
| 497 | if (! NILP (AREF (font_group, i))) | 501 | if (! NILP (AREF (font_group, i))) |