Skip to content

Commit e8476b2

Browse files
committed
Fix warning on Windows.
1 parent b775f13 commit e8476b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Python/pystate.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -2016,8 +2016,8 @@ _Py_GetConfig(void)
20162016

20172017
#define MINIMUM_OVERHEAD 1000
20182018

2019-
_Py_NO_INLINE PyObject **
2020-
_PyThreadState_PushChunk(PyThreadState *tstate, int size)
2019+
static PyObject **
2020+
push_chunk(PyThreadState *tstate, int size)
20212021
{
20222022
assert(tstate->datastack_top + size >= tstate->datastack_limit);
20232023

@@ -2044,10 +2044,11 @@ _PyThreadState_PushFrame(PyThreadState *tstate, PyFrameConstructor *con, PyObjec
20442044
int nlocalsplus = code->co_nlocalsplus;
20452045
size_t size = nlocalsplus + code->co_stacksize +
20462046
FRAME_SPECIALS_SIZE;
2047+
assert(size < INT_MAX/sizeof(PyObject *));
20472048
PyObject **localsarray = tstate->datastack_top;
20482049
PyObject **top = localsarray + size;
20492050
if (top >= tstate->datastack_limit) {
2050-
localsarray = _PyThreadState_PushChunk(tstate, size);
2051+
localsarray = push_chunk(tstate, (int)size);
20512052
if (localsarray == NULL) {
20522053
return NULL;
20532054
}

0 commit comments

Comments
 (0)