mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
GH-120982: Add stack check assertions to generated interpreter code (GH-120992)
This commit is contained in:
parent
42b2c9d78d
commit
8f5a01707f
8 changed files with 448 additions and 0 deletions
|
@ -301,6 +301,11 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
|
|||
|
||||
|
||||
#define STACK_LEVEL() ((int)(stack_pointer - ctx->frame->stack))
|
||||
#define STACK_SIZE() ((int)(ctx->frame->stack_len))
|
||||
|
||||
#define WITHIN_STACK_BOUNDS() \
|
||||
(STACK_LEVEL() >= 0 && STACK_LEVEL() <= STACK_SIZE())
|
||||
|
||||
|
||||
#define GETLOCAL(idx) ((ctx->frame->locals[idx]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue