diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_frame.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h index 883bef1..8eca39d 100644 --- a/Include/internal/pycore_frame.h +++ b/Include/internal/pycore_frame.h @@ -174,10 +174,13 @@ static inline InterpreterFrame * _PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size) { PyObject **base = tstate->datastack_top; - PyObject **top = base + size; - if (top < tstate->datastack_limit) { - tstate->datastack_top = top; - return (InterpreterFrame *)base; + if (base) { + PyObject **top = base + size; + assert(tstate->datastack_limit); + if (top < tstate->datastack_limit) { + tstate->datastack_top = top; + return (InterpreterFrame *)base; + } } return _PyThreadState_BumpFramePointerSlow(tstate, size); } |