Skip to content

Commit 1e6396e

Browse files
Paul Eggerteggert
authored andcommitted
Fix int overflow bug in ‘equal’
* src/fns.c (internal_equal): Fix bug when vector lengths exceed INT_MAX.
1 parent 5abaea3 commit 1e6396e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/fns.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,6 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
24252425

24262426
case Lisp_Vectorlike:
24272427
{
2428-
register int i;
24292428
ptrdiff_t size = ASIZE (o1);
24302429
/* Pseudovectors have the type encoded in the size field, so this test
24312430
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,
24792478
return false;
24802479
size &= PSEUDOVECTOR_SIZE_MASK;
24812480
}
2482-
for (i = 0; i < size; i++)
2481+
for (ptrdiff_t i = 0; i < size; i++)
24832482
{
24842483
Lisp_Object v1, v2;
24852484
v1 = AREF (o1, i);

0 commit comments

Comments
 (0)