emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/insdel.c


From: Andreas Schwab
Subject: [Emacs-diffs] Changes to emacs/src/insdel.c
Date: Sun, 06 Jan 2002 15:46:49 -0500

Index: emacs/src/insdel.c
diff -c emacs/src/insdel.c:1.163 emacs/src/insdel.c:1.164
*** emacs/src/insdel.c:1.163    Tue Dec 11 16:12:45 2001
--- emacs/src/insdel.c  Sun Jan  6 15:46:49 2002
***************
*** 533,542 ****
  
    /* Don't allow a buffer size that won't fit in an int
       even if it will fit in a Lisp integer.
!      That won't work because so many places use `int'.  */
       
!   if (Z_BYTE - BEG_BYTE + GAP_SIZE + nbytes_added
!       >= MOST_POSITIVE_FIXNUM)
      error ("Buffer exceeds maximum size");
  
    enlarge_buffer_text (current_buffer, nbytes_added);
--- 533,545 ----
  
    /* Don't allow a buffer size that won't fit in an int
       even if it will fit in a Lisp integer.
!      That won't work because so many places use `int'.
! 
!      Make sure we don't introduce overflows in the calculation.  */
       
!   if (Z_BYTE - BEG_BYTE + GAP_SIZE
!       >= (((EMACS_INT) 1 << (min (VALBITS, BITS_PER_INT) - 1)) - 1
!         - nbytes_added))
      error ("Buffer exceeds maximum size");
  
    enlarge_buffer_text (current_buffer, nbytes_added);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]