summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index b465a21..f6f9c96 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -47,7 +47,6 @@ static long polys[] = {
268435456 + 9,
536870912 + 5,
1073741824 + 83,
- 0
};
/* Object used as dummy key to fill deleted entries */
@@ -373,8 +372,10 @@ dictresize(dictobject *mp, int minused)
register dictentry *newtable;
register dictentry *ep;
register int i;
+
+ assert(minused >= 0);
for (i = 0, newsize = MINSIZE; ; i++, newsize <<= 1) {
- if (i > sizeof(polys)/sizeof(polys[0])) {
+ if (i >= sizeof(polys)/sizeof(polys[0])) {
/* Ran out of polynomials */
PyErr_NoMemory();
return -1;