summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@Penguin.CS.UCLA.EDU>2019-06-08 23:38:18 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-06-08 23:38:40 -0700
commit1e6396ec3df3b55cebf0f7380ed6dd43775a3a5b (patch)
tree27fba0a6180e5ee9c11d75fda1d6e14dc3a60749 /src/fns.c
parent5abaea334cf4c0e004fca2b8b272e091eb5b5444 (diff)
downloademacs-1e6396ec3df3b55cebf0f7380ed6dd43775a3a5b.tar.gz
Fix int overflow bug in ‘equal’
* src/fns.c (internal_equal): Fix bug when vector lengths exceed INT_MAX.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index 7d5443150d4..8307a36a09d 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2425,7 +2425,6 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
case Lisp_Vectorlike:
{
- register int i;
ptrdiff_t size = ASIZE (o1);
/* Pseudovectors have the type encoded in the size field, so this test
actually checks that the objects have the same type as well as the
@@ -2479,7 +2478,7 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
return false;
size &= PSEUDOVECTOR_SIZE_MASK;
}
- for (i = 0; i < size; i++)
+ for (ptrdiff_t i = 0; i < size; i++)
{
Lisp_Object v1, v2;
v1 = AREF (o1, i);