diff options
| author | Paul Eggert | 2011-07-11 11:36:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-11 11:36:33 -0700 |
| commit | e3c25c689524aa85ce37840fff344cc297cf42ec (patch) | |
| tree | d15969303dba67c2bc8da1ba5a37a39035765045 /src | |
| parent | da85a02af7585384008d3ebec836a7b8571f175d (diff) | |
| download | emacs-e3c25c689524aa85ce37840fff344cc297cf42ec.tar.gz emacs-e3c25c689524aa85ce37840fff344cc297cf42ec.zip | |
* dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
The plain *_OVERFLOW macros run afoul of GCC bug 49705
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
and therefore cause GCC to emit a bogus diagnostic in some cases.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4e69399154d..c519100b2f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-07-11 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-07-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros. | ||
| 4 | The plain *_OVERFLOW macros run afoul of GCC bug 49705 | ||
| 5 | <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705> | ||
| 6 | and therefore cause GCC to emit a bogus diagnostic in some cases. | ||
| 7 | |||
| 3 | * image.c: Integer signedness and overflow and related fixes. | 8 | * image.c: Integer signedness and overflow and related fixes. |
| 4 | This is not an exhaustive set of fixes, but it's time to | 9 | This is not an exhaustive set of fixes, but it's time to |
| 5 | record what I've got. | 10 | record what I've got. |
diff --git a/src/dispnew.c b/src/dispnew.c index 15d80367701..d52bbdf1d3e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6298,8 +6298,8 @@ init_display (void) | |||
| 6298 | change. It's not clear what better we could do. The rest of | 6298 | change. It's not clear what better we could do. The rest of |
| 6299 | the code assumes that (width + 2) * height * sizeof (struct glyph) | 6299 | the code assumes that (width + 2) * height * sizeof (struct glyph) |
| 6300 | does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */ | 6300 | does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */ |
| 6301 | if (INT_ADD_OVERFLOW (width, 2) | 6301 | if (INT_ADD_RANGE_OVERFLOW (width, 2, INT_MIN, INT_MAX) |
| 6302 | || INT_MULTIPLY_OVERFLOW (width + 2, height) | 6302 | || INT_MULTIPLY_RANGE_OVERFLOW (width + 2, height, INT_MIN, INT_MAX) |
| 6303 | || (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph) | 6303 | || (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph) |
| 6304 | < (width + 2) * height)) | 6304 | < (width + 2) * height)) |
| 6305 | fatal ("screen size %dx%d too big", width, height); | 6305 | fatal ("screen size %dx%d too big", width, height); |