diff options
| author | Mattias EngdegÄrd | 2019-07-22 13:45:40 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-07-22 19:26:21 +0200 |
| commit | 7e294d55e1506443e711f44c85caf490ded80fe8 (patch) | |
| tree | 11549eb71f39826c4d044a3d3505ceee56084a78 | |
| parent | 87ad8a11437752f3a5f7f1096328e3b9d11bba9f (diff) | |
| download | emacs-7e294d55e1506443e711f44c85caf490ded80fe8.tar.gz emacs-7e294d55e1506443e711f44c85caf490ded80fe8.zip | |
Remove some obsolete integer overflow handling
* lisp/subr.el (number-sequence):
* lisp/org/org-gnus.el (org-gnus-follow-link):
* lisp/ls-lisp.el (ls-lisp-insert-directory):
Remove dead code guarding against integer overflow.
| -rw-r--r-- | lisp/ls-lisp.el | 9 | ||||
| -rw-r--r-- | lisp/org/org-gnus.el | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 6 |
3 files changed, 4 insertions, 15 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 66c56f0fcee..e802c2408f7 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el | |||
| @@ -420,14 +420,7 @@ not contain `d', so that a full listing is expected." | |||
| 420 | attr (cdr elt) | 420 | attr (cdr elt) |
| 421 | file-size (file-attribute-size attr)) | 421 | file-size (file-attribute-size attr)) |
| 422 | (and attr | 422 | (and attr |
| 423 | (setq sum (+ file-size | 423 | (setq sum (+ file-size sum)) |
| 424 | ;; Even if neither SUM nor file's size | ||
| 425 | ;; overflow, their sum could. | ||
| 426 | (if (or (< sum (- 134217727 file-size)) | ||
| 427 | (floatp sum) | ||
| 428 | (floatp file-size)) | ||
| 429 | sum | ||
| 430 | (float sum)))) | ||
| 431 | (insert (ls-lisp-format short attr file-size | 424 | (insert (ls-lisp-format short attr file-size |
| 432 | switches time-index)))) | 425 | switches time-index)))) |
| 433 | ;; Insert total size of all files: | 426 | ;; Insert total size of all files: |
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index 2cb2766ee19..15e95647a09 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el | |||
| @@ -242,9 +242,7 @@ If `org-store-link' was called with a prefix arg the meaning of | |||
| 242 | (_ | 242 | (_ |
| 243 | (let ((articles 1) | 243 | (let ((articles 1) |
| 244 | group-opened) | 244 | group-opened) |
| 245 | (while (and (not group-opened) | 245 | (while (not group-opened) |
| 246 | ;; Stop on integer overflows. | ||
| 247 | (> articles 0)) | ||
| 248 | (setq group-opened (gnus-group-read-group articles t group)) | 246 | (setq group-opened (gnus-group-read-group articles t group)) |
| 249 | (setq articles (if (< articles 16) | 247 | (setq articles (if (< articles 16) |
| 250 | (1+ articles) | 248 | (1+ articles) |
diff --git a/lisp/subr.el b/lisp/subr.el index 4a1649f6019..9fd3366f8a6 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -681,14 +681,12 @@ of course, also replace TO with a slightly larger value | |||
| 681 | (when (zerop inc) (error "The increment can not be zero")) | 681 | (when (zerop inc) (error "The increment can not be zero")) |
| 682 | (let (seq (n 0) (next from) (last from)) | 682 | (let (seq (n 0) (next from) (last from)) |
| 683 | (if (> inc 0) | 683 | (if (> inc 0) |
| 684 | ;; The (>= next last) condition protects against integer | 684 | (while (<= next to) |
| 685 | ;; overflow in computing NEXT. | ||
| 686 | (while (and (>= next last) (<= next to)) | ||
| 687 | (setq seq (cons next seq) | 685 | (setq seq (cons next seq) |
| 688 | n (1+ n) | 686 | n (1+ n) |
| 689 | last next | 687 | last next |
| 690 | next (+ from (* n inc)))) | 688 | next (+ from (* n inc)))) |
| 691 | (while (and (<= next last) (>= next to)) | 689 | (while (>= next to) |
| 692 | (setq seq (cons next seq) | 690 | (setq seq (cons next seq) |
| 693 | n (1+ n) | 691 | n (1+ n) |
| 694 | next (+ from (* n inc))))) | 692 | next (+ from (* n inc))))) |