[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 45cdacb: * src/dispnew.c (init_display): Simplify o
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 45cdacb: * src/dispnew.c (init_display): Simplify overflow checking. |
Date: |
Wed, 28 Oct 2015 16:10:42 +0000 |
branch: master
commit 45cdacb09890121bdcf07279b2fe5bc6a52fa22c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
* src/dispnew.c (init_display): Simplify overflow checking.
---
src/dispnew.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dispnew.c b/src/dispnew.c
index 18eed3c..9164076 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6097,8 +6097,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_RANGE_OVERFLOW (width, 2, INT_MIN, INT_MAX)
- || INT_MULTIPLY_RANGE_OVERFLOW (width + 2, height, INT_MIN, INT_MAX)
+ if (INT_ADD_OVERFLOW (width, 2)
+ || INT_MULTIPLY_OVERFLOW (width + 2, height)
|| (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph)
< (width + 2) * height))
fatal ("screen size %dx%d too big", width, height);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 45cdacb: * src/dispnew.c (init_display): Simplify overflow checking.,
Paul Eggert <=