8000 Fix crash when the stackref is NULL. · python/cpython@345ad57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 345ad57

Browse files
committed
Fix crash when the stackref is NULL.
1 parent 3a8cefb commit 345ad57

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4304,6 +4304,7 @@ dummy_func(
43044304
EXIT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS));
43054305
PyTypeObject *d_type = method->d_common.d_type;
43064306
PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
4307+
EXIT_IF(self == NULL);
43074308
EXIT_IF(!Py_IS_TYPE(self, d_type));
43084309
STAT_INC(CALL, hit);
43094310
int nargs = total_args - 1;
@@ -4382,6 +4383,7 @@ dummy_func(
43824383
PyMethodDef *meth = method->d_method;
43834384
EXIT_IF(meth->ml_flags != METH_FASTCALL);
43844385
PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
4386+
EXIT_IF(self == NULL);
43854387
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
43864388
STAT_INC(CALL, hit);
43874389
int nargs = total_args - 1;

Python/executor_cases.c.h

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0