Skip to content

Commit 5aca882

Browse files
committed
Merged revisions 66383 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r66383 | martin.v.loewis | 2008-09-11 08:53:30 +0200 (Do, 11 Sep 2008) | 3 lines Issue python#3642: Suppress warning in obmalloc when size_t is larger than uint. Reverts r65975. Reviewed by Brett Cannon. ........
1 parent 51bff5d commit 5aca882

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎Objects/obmalloc.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ new_arena(void)
517517
#endif
518518
if (unused_arena_objects == NULL) {
519519
uint i;
520-
size_t numarenas;
520+
uint numarenas;
521521
size_t nbytes;
522522

523523
/* Double the number of arena objects on each allocation.
@@ -526,8 +526,10 @@ new_arena(void)
526526
numarenas = maxarenas ? maxarenas << 1 : INITIAL_ARENA_OBJECTS;
527527
if (numarenas <= maxarenas)
528528
return NULL; /* overflow */
529+
#if SIZEOF_SIZE_T <= SIZEOF_INT
529530
if (numarenas > PY_SIZE_MAX / sizeof(*arenas))
530531
return NULL; /* overflow */
532+
#endif
531533
nbytes = numarenas * sizeof(*arenas);
532534
arenaobj = (struct arena_object *)realloc(arenas, nbytes);
533535
if (arenaobj == NULL)

0 commit comments

Comments
 (0)