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

@ -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]))