diff options
| author | Stefan Monnier | 2009-11-19 01:40:22 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-19 01:40:22 +0000 |
| commit | 87e32266f0fc8467bc8280c9b73b7c5ab9d5f951 (patch) | |
| tree | ce23ebb18e3d66069782425bbf0ba344d90407f4 /src | |
| parent | b2f0be0f79c0275c1677fee1a2ff62c42febc623 (diff) | |
| download | emacs-87e32266f0fc8467bc8280c9b73b7c5ab9d5f951.tar.gz emacs-87e32266f0fc8467bc8280c9b73b7c5ab9d5f951.zip | |
(make_gap_larger): Don't make as many assumptions about the
representation of Lisp integers.
Reported by MJ Chan <mjchan.inbox@gmail.com>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 32 | ||||
| -rw-r--r-- | src/insdel.c | 20 |
2 files changed, 29 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 713bfe7d7d6..474bc2e0e26 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-11-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * insdel.c (make_gap_larger): Don't make as many assumptions about the | ||
| 4 | representation of Lisp integers. | ||
| 5 | Reported by MJ Chan <mjchan.inbox@gmail.com>. | ||
| 6 | |||
| 1 | 2009-11-17 Andreas Schwab <schwab@linux-m68k.org> | 7 | 2009-11-17 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 8 | ||
| 3 | * lisp.h: Remove declaration of Ffont_get_system_font. | 9 | * lisp.h: Remove declaration of Ffont_get_system_font. |
| @@ -6,8 +12,8 @@ | |||
| 6 | 12 | ||
| 7 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> | 13 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> |
| 8 | 14 | ||
| 9 | * xsettings.c (something_changedCB, Ffont_get_system_font): Check | 15 | * xsettings.c (something_changedCB, Ffont_get_system_font): |
| 10 | use_system_font. | 16 | Check use_system_font. |
| 11 | (syms_of_xsettings): DEFVAR font-use-system-font. | 17 | (syms_of_xsettings): DEFVAR font-use-system-font. |
| 12 | 18 | ||
| 13 | 2009-11-17 Andreas Schwab <schwab@linux-m68k.org> | 19 | 2009-11-17 Andreas Schwab <schwab@linux-m68k.org> |
| @@ -18,10 +24,10 @@ | |||
| 18 | 24 | ||
| 19 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> | 25 | 2009-11-17 Jan Djärv <jan.h.d@swipnet.se> |
| 20 | 26 | ||
| 21 | * xftfont.c (xftfont_fix_match): Older versions of fontconfig does | 27 | * xftfont.c (xftfont_fix_match): Older versions of fontconfig do |
| 22 | not have FC_LCD_*. #define them if not there. | 28 | not have FC_LCD_*. #define them if not there. |
| 23 | 29 | ||
| 24 | * xsettings.c (parse_xft_settings, apply_xft_settings): Ditto | 30 | * xsettings.c (parse_xft_settings, apply_xft_settings): Ditto. |
| 25 | 31 | ||
| 26 | * xterm.h (struct x_display_info): Add atoms and Window for xsettings. | 32 | * xterm.h (struct x_display_info): Add atoms and Window for xsettings. |
| 27 | 33 | ||
| @@ -36,10 +42,11 @@ | |||
| 36 | 42 | ||
| 37 | * xfont.c (xfont_driver): Initialize all members. | 43 | * xfont.c (xfont_driver): Initialize all members. |
| 38 | 44 | ||
| 39 | * xfns.c (x_default_font_parameter): Try font from Ffont_get_system_font. | 45 | * xfns.c (x_default_font_parameter): |
| 46 | Try font from Ffont_get_system_font. | ||
| 40 | Do not get font from x_default_parameter if we got one from | 47 | Do not get font from x_default_parameter if we got one from |
| 41 | Ffont_get_system_font. | 48 | Ffont_get_system_font. |
| 42 | (Fx_select_font): Get the defaut font name from :name of FRAME_FONT (f). | 49 | (Fx_select_font): Get the defaut font name from :name of FRAME_FONT(f). |
| 43 | 50 | ||
| 44 | * w32font.c (w32font_driver): Initialize all members. | 51 | * w32font.c (w32font_driver): Initialize all members. |
| 45 | 52 | ||
| @@ -47,22 +54,22 @@ | |||
| 47 | 54 | ||
| 48 | * lisp.h: Declare syms_of_xsettings. | 55 | * lisp.h: Declare syms_of_xsettings. |
| 49 | 56 | ||
| 50 | * keyboard.c (kbd_buffer_get_event, make_lispy_event): Handle | 57 | * keyboard.c (kbd_buffer_get_event, make_lispy_event): |
| 51 | CONFIG_CHANGED_EVENT. | 58 | Handle CONFIG_CHANGED_EVENT. |
| 52 | 59 | ||
| 53 | * ftfont.c (ftfont_filter_properties): New function. | 60 | * ftfont.c (ftfont_filter_properties): New function. |
| 54 | 61 | ||
| 55 | * frame.c (x_set_font): Remove unused variable lval. | 62 | * frame.c (x_set_font): Remove unused variable lval. |
| 56 | 63 | ||
| 57 | * font.h (struct font_driver): filter_properties is new. | 64 | * font.h (struct font_driver): Add filter_properties. |
| 58 | 65 | ||
| 59 | * font.c (font_put_extra): Don't return if val is nil, it means | 66 | * font.c (font_put_extra): Don't return if val is nil, it means |
| 60 | boolean option is off. | 67 | boolean option is off. |
| 61 | (font_parse_fcname): Collect all extra properties in extra_props | 68 | (font_parse_fcname): Collect all extra properties in extra_props |
| 62 | and call filter_properties for all drivers with extra_props and | 69 | and call filter_properties for all drivers with extra_props and |
| 63 | font as parameter. | 70 | font as parameter. |
| 64 | (font_open_entity): Do not use cache, it does not pick up new fontconfig | 71 | (font_open_entity): Do not use cache, it does not pick up new |
| 65 | settings like hinting. | 72 | fontconfig settings like hinting. |
| 66 | (font_load_for_lface): If spec had a name in it, store it in entity. | 73 | (font_load_for_lface): If spec had a name in it, store it in entity. |
| 67 | 74 | ||
| 68 | * emacs.c (main): Call syms_of_xsettings | 75 | * emacs.c (main): Call syms_of_xsettings |
| @@ -89,8 +96,7 @@ | |||
| 89 | 96 | ||
| 90 | 2009-11-14 Andreas Schwab <schwab@linux-m68k.org> | 97 | 2009-11-14 Andreas Schwab <schwab@linux-m68k.org> |
| 91 | 98 | ||
| 92 | * Makefile.in: Ignore errors from mkdir when creating deps | 99 | * Makefile.in: Ignore errors from mkdir when creating deps directory. |
| 93 | directory. | ||
| 94 | 100 | ||
| 95 | 2009-11-14 Jan Djärv <jan.h.d@swipnet.se> | 101 | 2009-11-14 Jan Djärv <jan.h.d@swipnet.se> |
| 96 | 102 | ||
diff --git a/src/insdel.c b/src/insdel.c index bdd450558bd..0faf3c07227 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -512,16 +512,16 @@ make_gap_larger (EMACS_INT nbytes_added) | |||
| 512 | /* If we have to get more space, get enough to last a while. */ | 512 | /* If we have to get more space, get enough to last a while. */ |
| 513 | nbytes_added += 2000; | 513 | nbytes_added += 2000; |
| 514 | 514 | ||
| 515 | /* Don't allow a buffer size that won't fit in an int | 515 | { EMACS_INT total_size = Z_BYTE - BEG_BYTE + GAP_SIZE + nbytes_added; |
| 516 | even if it will fit in a Lisp integer. | 516 | if (total_size < 0 |
| 517 | That won't work because so many places use `int'. | 517 | /* Don't allow a buffer size that won't fit in a Lisp integer. */ |
| 518 | 518 | || total_size != XINT (make_number (total_size)) | |
| 519 | Make sure we don't introduce overflows in the calculation. */ | 519 | /* Don't allow a buffer size that won't fit in an int |
| 520 | 520 | even if it will fit in a Lisp integer. | |
| 521 | if (Z_BYTE - BEG_BYTE + GAP_SIZE | 521 | That won't work because so many places still use `int'. */ |
| 522 | >= (((EMACS_INT) 1 << (min (VALBITS, BITS_PER_INT) - 1)) - 1 | 522 | || total_size != (EMACS_INT) (int) total_size) |
| 523 | - nbytes_added)) | 523 | error ("Buffer exceeds maximum size"); |
| 524 | error ("Buffer exceeds maximum size"); | 524 | } |
| 525 | 525 | ||
| 526 | enlarge_buffer_text (current_buffer, nbytes_added); | 526 | enlarge_buffer_text (current_buffer, nbytes_added); |
| 527 | 527 | ||