mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
GH-123185: Check for NULL
after calling _PyEvalFramePushAndInit
(GH-123194)
This commit is contained in:
parent
90c892efea
commit
1eba8bae92
5 changed files with 29 additions and 4 deletions
|
@ -3584,8 +3584,12 @@ dummy_func(
|
|||
args[-1] = self;
|
||||
init_frame = _PyEvalFramePushAndInit(
|
||||
tstate, init_func, NULL, args-1, oparg+1, NULL, shim);
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
SYNC_SP();
|
||||
if (init_frame == NULL) {
|
||||
_PyEval_FrameClearAndPop(tstate, shim);
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
/* Account for pushing the extra frame.
|
||||
* We don't check recursion depth here,
|
||||
* as it will be checked after start_frame */
|
||||
|
|
6
Python/executor_cases.c.h
generated
6
Python/executor_cases.c.h
generated
|
@ -4152,9 +4152,13 @@
|
|||
args[-1] = self;
|
||||
init_frame = _PyEvalFramePushAndInit(
|
||||
tstate, init_func, NULL, args-1, oparg+1, NULL, shim);
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
stack_pointer += -2 - oparg;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
if (init_frame == NULL) {
|
||||
_PyEval_FrameClearAndPop(tstate, shim);
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
/* Account for pushing the extra frame.
|
||||
* We don't check recursion depth here,
|
||||
* as it will be checked after start_frame */
|
||||
|
|
6
Python/generated_cases.c.h
generated
6
Python/generated_cases.c.h
generated
|
@ -1020,9 +1020,13 @@
|
|||
args[-1] = self;
|
||||
init_frame = _PyEvalFramePushAndInit(
|
||||
tstate, init_func, NULL, args-1, oparg+1, NULL, shim);
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
stack_pointer += -2 - oparg;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
if (init_frame == NULL) {
|
||||
_PyEval_FrameClearAndPop(tstate, shim);
|
||||
goto error;
|
||||
}
|
||||
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
|
||||
/* Account for pushing the extra frame.
|
||||
* We don't check recursion depth here,
|
||||
* as it will be checked after start_frame */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue