aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorAndreas Schwab2014-07-26 13:58:24 +0200
committerAndreas Schwab2014-07-26 13:58:24 +0200
commit3acf58eec890249179b6f992c59f9adcf05b8ca8 (patch)
tree330419ff2ccea3f5aea9d49bd0e5aba8b1d386b2 /src/lread.c
parenta072c708aaa91e61fa148b1a69884a40a5d8f9fb (diff)
downloademacs-3acf58eec890249179b6f992c59f9adcf05b8ca8.tar.gz
emacs-3acf58eec890249179b6f992c59f9adcf05b8ca8.zip
Reorder conditions that are written backwards
* alloc.c (xnmalloc, xnrealloc, xpalloc, make_save_value) (Fgarbage_collect): Reorder conditions that are written backwards. * data.c (cons_to_unsigned): Likewise. * dispnew.c (update_frame_1, sit_for): Likewise. * fileio.c (file_offset): Likewise. * filelock.c (read_lock_data, lock_file): Likewise. * fns.c (larger_vector, make_hash_table, Fmake_hash_table): Likewise. * font.c (font_intern_prop, font_style_symbolic): Likewise. * lisp.h (FIXNUM_OVERFLOW_P): Likewise. * lread.c (read1): Likewise. * minibuf.c (read_minibuf_noninteractive): Likewise. * nsterm.m (x_set_frame_alpha): Likewise. * process.c (wait_reading_process_output): Likewise. * region-cache.c (delete_cache_boundaries): Likewise. * xterm.c (x_set_frame_alpha): Likewise.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c
index 639d574ac6b..25c3503d86b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2747,7 +2747,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2747 while ((c = READCHAR) >= 0 2747 while ((c = READCHAR) >= 0
2748 && c >= '0' && c <= '9') 2748 && c >= '0' && c <= '9')
2749 { 2749 {
2750 if ((STRING_BYTES_BOUND - extra) / 10 <= nskip) 2750 if (nskip >= (STRING_BYTES_BOUND - extra) / 10)
2751 string_overflow (); 2751 string_overflow ();
2752 digits++; 2752 digits++;
2753 nskip *= 10; 2753 nskip *= 10;
@@ -2861,8 +2861,8 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2861 /* Read a non-negative integer. */ 2861 /* Read a non-negative integer. */
2862 while (c >= '0' && c <= '9') 2862 while (c >= '0' && c <= '9')
2863 { 2863 {
2864 if (MOST_POSITIVE_FIXNUM / 10 < n 2864 if (n > MOST_POSITIVE_FIXNUM / 10
2865 || MOST_POSITIVE_FIXNUM < n * 10 + c - '0') 2865 || n * 10 + c - '0' > MOST_POSITIVE_FIXNUM)
2866 n = MOST_POSITIVE_FIXNUM + 1; 2866 n = MOST_POSITIVE_FIXNUM + 1;
2867 else 2867 else
2868 n = n * 10 + c - '0'; 2868 n = n * 10 + c - '0';
@@ -3058,7 +3058,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3058 if (end - p < MAX_MULTIBYTE_LENGTH) 3058 if (end - p < MAX_MULTIBYTE_LENGTH)
3059 { 3059 {
3060 ptrdiff_t offset = p - read_buffer; 3060 ptrdiff_t offset = p - read_buffer;
3061 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) 3061 if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
3062 memory_full (SIZE_MAX); 3062 memory_full (SIZE_MAX);
3063 read_buffer = xrealloc (read_buffer, read_buffer_size * 2); 3063 read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
3064 read_buffer_size *= 2; 3064 read_buffer_size *= 2;
@@ -3192,7 +3192,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3192 if (end - p < MAX_MULTIBYTE_LENGTH) 3192 if (end - p < MAX_MULTIBYTE_LENGTH)
3193 { 3193 {
3194 ptrdiff_t offset = p - read_buffer; 3194 ptrdiff_t offset = p - read_buffer;
3195 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) 3195 if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
3196 memory_full (SIZE_MAX); 3196 memory_full (SIZE_MAX);
3197 read_buffer = xrealloc (read_buffer, read_buffer_size * 2); 3197 read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
3198 read_buffer_size *= 2; 3198 read_buffer_size *= 2;
@@ -3222,7 +3222,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3222 if (p == end) 3222 if (p == end)
3223 { 3223 {
3224 ptrdiff_t offset = p - read_buffer; 3224 ptrdiff_t offset = p - read_buffer;
3225 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size) 3225 if (read_buffer_size > min (PTRDIFF_MAX, SIZE_MAX) / 2)
3226 memory_full (SIZE_MAX); 3226 memory_full (SIZE_MAX);
3227 read_buffer = xrealloc (read_buffer, read_buffer_size * 2); 3227 read_buffer = xrealloc (read_buffer, read_buffer_size * 2);
3228 read_buffer_size *= 2; 3228 read_buffer_size *= 2;