Commit e3c25c68 authored by Paul Eggert's avatar Paul Eggert
Browse files

* 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.
parent da85a02a
2011-07-11 Paul Eggert <eggert@cs.ucla.edu>
* 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.
* image.c: Integer signedness and overflow and related fixes.
This is not an exhaustive set of fixes, but it's time to
record what I've got.
......
......@@ -6298,8 +6298,8 @@ init_display (void)
change. It's not clear what better we could do. The rest of
the code assumes that (width + 2) * height * sizeof (struct glyph)
does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */
if (INT_ADD_OVERFLOW (width, 2)
|| INT_MULTIPLY_OVERFLOW (width + 2, height)
if (INT_ADD_RANGE_OVERFLOW (width, 2, INT_MIN, INT_MAX)
|| INT_MULTIPLY_RANGE_OVERFLOW (width + 2, height, INT_MIN, INT_MAX)
|| (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph)
< (width + 2) * height))
fatal ("screen size %dx%d too big", width, height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment