aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-08-21 12:44:56 +0100
committerGitHub <noreply@github.com>2024-08-21 12:44:56 +0100
commit1eba8bae9223600677dfa3a4ce8b7e4d2b8fd00d (patch)
tree90f3f920f8559e83452f974aa15e9485f1d250f8 /Python/bytecodes.c
parent90c892efeaae28bd849a01b42842f19dcd67b9f4 (diff)
downloadcpython-1eba8bae9223600677dfa3a4ce8b7e4d2b8fd00d.tar.gz
cpython-1eba8bae9223600677dfa3a4ce8b7e4d2b8fd00d.zip
GH-123185: Check for `NULL` after calling `_PyEvalFramePushAndInit` (GH-123194)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index ec0f6ab8fde..3edd3746541 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -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 */