mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
gh-145866: Convert _CALL_METHOD_DESCRIPTOR_NOARGS to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-148227)
This commit is contained in:
parent
d2fa4b2b13
commit
bb03c8bd02
10 changed files with 140 additions and 74 deletions
|
|
@ -1407,7 +1407,7 @@ dummy_func(void) {
|
|||
ctx->frame->is_c_recursion_checked = true;
|
||||
}
|
||||
|
||||
op(_CALL_METHOD_DESCRIPTOR_NOARGS, (callable, self_or_null, args[oparg] -- res)) {
|
||||
op(_CALL_METHOD_DESCRIPTOR_NOARGS, (callable, self_or_null, args[oparg] -- res, c, s)) {
|
||||
PyObject *callable_o = sym_get_const(ctx, callable);
|
||||
if (callable_o && Py_IS_TYPE(callable_o, &PyMethodDescr_Type)
|
||||
&& sym_is_not_null(self_or_null)) {
|
||||
|
|
@ -1416,6 +1416,17 @@ dummy_func(void) {
|
|||
ADD_OP(_CALL_METHOD_DESCRIPTOR_NOARGS_INLINE, oparg + 1, (uintptr_t)cfunc);
|
||||
}
|
||||
res = sym_new_not_null(ctx);
|
||||
c = callable;
|
||||
if (sym_is_not_null(self_or_null)) {
|
||||
args--;
|
||||
s = args[0];
|
||||
}
|
||||
else if (sym_is_null(self_or_null)) {
|
||||
s = args[0];
|
||||
}
|
||||
else {
|
||||
s = sym_new_unknown(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (callable, self_or_null, args[oparg] -- res)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue