diff --git a/Objects/frameobject.c b/Objects/frameobject.c index db4e4b7e1939de..f9a5a3a573edab 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1363,6 +1363,11 @@ mark_stacks(PyCodeObject *code_obj, int len) } case SEND: j = oparg + i + INLINE_CACHE_ENTRIES_SEND + 1; + if (j < 0) { + PyErr_SetString(PyExc_OverflowError, + "integer overflow"); + return NULL; + } assert(j < len); assert(stacks[j] == UNINITIALIZED || stacks[j] == next_stack); stacks[j] = next_stack;