Commit 1e6396ec authored by Paul Eggert's avatar Paul Eggert Committed by Paul Eggert

Fix int overflow bug in ‘equal’

* src/fns.c (internal_equal):
Fix bug when vector lengths exceed INT_MAX.
parent 5abaea33
Pipeline #1941 failed with stage
in 17 seconds
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment