GH-120982: Add stack check assertions to generated interpreter code (GH-120992)

This commit is contained in:
Mark Shannon 2024-06-25 16:42:29 +01:00 committed by GitHub
parent 42b2c9d78d
commit 8f5a01707f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 448 additions and 0 deletions

View file

@ -246,6 +246,8 @@ GETITEM(PyObject *v, Py_ssize_t i) {
#define STACK_SHRINK(n) BASIC_STACKADJ(-(n))
#endif
#define WITHIN_STACK_BOUNDS() \
(frame == &entry_frame || (STACK_LEVEL() >= 0 && STACK_LEVEL() <= STACK_SIZE()))
/* Data access macros */
#define FRAME_CO_CONSTS (_PyFrame_GetCode(frame)->co_consts)