mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
[3.12] GH-106895: Raise a ValueError
when attempting to disable events that cannot be disabled. (GH-107337) (GH-107351)
This commit is contained in:
parent
3b1a4c1842
commit
0902afbae2
8 changed files with 207 additions and 144 deletions
193
Python/generated_cases.c.h
generated
193
Python/generated_cases.c.h
generated
|
@ -3579,14 +3579,19 @@
|
|||
assert(val && PyExceptionInstance_Check(val));
|
||||
exc = PyExceptionInstance_Class(val);
|
||||
tb = PyException_GetTraceback(val);
|
||||
Py_XDECREF(tb);
|
||||
if (tb == NULL) {
|
||||
tb = Py_None;
|
||||
}
|
||||
else {
|
||||
Py_DECREF(tb);
|
||||
}
|
||||
assert(PyLong_Check(lasti));
|
||||
(void)lasti; // Shut up compiler warning if asserts are off
|
||||
PyObject *stack[4] = {NULL, exc, val, tb};
|
||||
res = PyObject_Vectorcall(exit_func, stack + 1,
|
||||
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
||||
if (res == NULL) goto error;
|
||||
#line 3590 "Python/generated_cases.c.h"
|
||||
#line 3595 "Python/generated_cases.c.h"
|
||||
STACK_GROW(1);
|
||||
stack_pointer[-1] = res;
|
||||
DISPATCH();
|
||||
|
@ -3595,7 +3600,7 @@
|
|||
TARGET(PUSH_EXC_INFO) {
|
||||
PyObject *new_exc = stack_pointer[-1];
|
||||
PyObject *prev_exc;
|
||||
#line 2489 "Python/bytecodes.c"
|
||||
#line 2494 "Python/bytecodes.c"
|
||||
_PyErr_StackItem *exc_info = tstate->exc_info;
|
||||
if (exc_info->exc_value != NULL) {
|
||||
prev_exc = exc_info->exc_value;
|
||||
|
@ -3605,7 +3610,7 @@
|
|||
}
|
||||
assert(PyExceptionInstance_Check(new_exc));
|
||||
exc_info->exc_value = Py_NewRef(new_exc);
|
||||
#line 3609 "Python/generated_cases.c.h"
|
||||
#line 3614 "Python/generated_cases.c.h"
|
||||
STACK_GROW(1);
|
||||
stack_pointer[-1] = new_exc;
|
||||
stack_pointer[-2] = prev_exc;
|
||||
|
@ -3619,7 +3624,7 @@
|
|||
uint32_t type_version = read_u32(&next_instr[1].cache);
|
||||
uint32_t keys_version = read_u32(&next_instr[3].cache);
|
||||
PyObject *descr = read_obj(&next_instr[5].cache);
|
||||
#line 2501 "Python/bytecodes.c"
|
||||
#line 2506 "Python/bytecodes.c"
|
||||
/* Cached method object */
|
||||
PyTypeObject *self_cls = Py_TYPE(self);
|
||||
assert(type_version != 0);
|
||||
|
@ -3636,7 +3641,7 @@
|
|||
assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR));
|
||||
res = self;
|
||||
assert(oparg & 1);
|
||||
#line 3640 "Python/generated_cases.c.h"
|
||||
#line 3645 "Python/generated_cases.c.h"
|
||||
STACK_GROW(((oparg & 1) ? 1 : 0));
|
||||
stack_pointer[-1] = res;
|
||||
if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
|
||||
|
@ -3650,7 +3655,7 @@
|
|||
PyObject *res;
|
||||
uint32_t type_version = read_u32(&next_instr[1].cache);
|
||||
PyObject *descr = read_obj(&next_instr[5].cache);
|
||||
#line 2520 "Python/bytecodes.c"
|
||||
#line 2525 "Python/bytecodes.c"
|
||||
PyTypeObject *self_cls = Py_TYPE(self);
|
||||
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
|
||||
assert(self_cls->tp_dictoffset == 0);
|
||||
|
@ -3660,7 +3665,7 @@
|
|||
res2 = Py_NewRef(descr);
|
||||
res = self;
|
||||
assert(oparg & 1);
|
||||
#line 3664 "Python/generated_cases.c.h"
|
||||
#line 3669 "Python/generated_cases.c.h"
|
||||
STACK_GROW(((oparg & 1) ? 1 : 0));
|
||||
stack_pointer[-1] = res;
|
||||
if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
|
||||
|
@ -3674,7 +3679,7 @@
|
|||
PyObject *res;
|
||||
uint32_t type_version = read_u32(&next_instr[1].cache);
|
||||
PyObject *descr = read_obj(&next_instr[5].cache);
|
||||
#line 2532 "Python/bytecodes.c"
|
||||
#line 2537 "Python/bytecodes.c"
|
||||
PyTypeObject *self_cls = Py_TYPE(self);
|
||||
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
|
||||
Py_ssize_t dictoffset = self_cls->tp_dictoffset;
|
||||
|
@ -3688,7 +3693,7 @@
|
|||
res2 = Py_NewRef(descr);
|
||||
res = self;
|
||||
assert(oparg & 1);
|
||||
#line 3692 "Python/generated_cases.c.h"
|
||||
#line 3697 "Python/generated_cases.c.h"
|
||||
STACK_GROW(((oparg & 1) ? 1 : 0));
|
||||
stack_pointer[-1] = res;
|
||||
if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
|
||||
|
@ -3697,16 +3702,16 @@
|
|||
}
|
||||
|
||||
TARGET(KW_NAMES) {
|
||||
#line 2548 "Python/bytecodes.c"
|
||||
#line 2553 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts));
|
||||
kwnames = GETITEM(frame->f_code->co_consts, oparg);
|
||||
#line 3705 "Python/generated_cases.c.h"
|
||||
#line 3710 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_CALL) {
|
||||
#line 2554 "Python/bytecodes.c"
|
||||
#line 2559 "Python/bytecodes.c"
|
||||
int is_meth = PEEK(oparg+2) != NULL;
|
||||
int total_args = oparg + is_meth;
|
||||
PyObject *function = PEEK(total_args + 1);
|
||||
|
@ -3719,7 +3724,7 @@
|
|||
_PyCallCache *cache = (_PyCallCache *)next_instr;
|
||||
INCREMENT_ADAPTIVE_COUNTER(cache->counter);
|
||||
GO_TO_INSTRUCTION(CALL);
|
||||
#line 3723 "Python/generated_cases.c.h"
|
||||
#line 3728 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL) {
|
||||
|
@ -3729,7 +3734,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2599 "Python/bytecodes.c"
|
||||
#line 2604 "Python/bytecodes.c"
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
if (is_meth) {
|
||||
|
@ -3811,7 +3816,7 @@
|
|||
Py_DECREF(args[i]);
|
||||
}
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 3815 "Python/generated_cases.c.h"
|
||||
#line 3820 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -3823,7 +3828,7 @@
|
|||
TARGET(CALL_BOUND_METHOD_EXACT_ARGS) {
|
||||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
#line 2687 "Python/bytecodes.c"
|
||||
#line 2692 "Python/bytecodes.c"
|
||||
DEOPT_IF(method != NULL, CALL);
|
||||
DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL);
|
||||
STAT_INC(CALL, hit);
|
||||
|
@ -3833,7 +3838,7 @@
|
|||
PEEK(oparg + 2) = Py_NewRef(meth); // method
|
||||
Py_DECREF(callable);
|
||||
GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS);
|
||||
#line 3837 "Python/generated_cases.c.h"
|
||||
#line 3842 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL_PY_EXACT_ARGS) {
|
||||
|
@ -3842,7 +3847,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
uint32_t func_version = read_u32(&next_instr[1].cache);
|
||||
#line 2699 "Python/bytecodes.c"
|
||||
#line 2704 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
DEOPT_IF(tstate->interp->eval_frame, CALL);
|
||||
int is_meth = method != NULL;
|
||||
|
@ -3868,7 +3873,7 @@
|
|||
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
|
||||
frame->return_offset = 0;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
#line 3872 "Python/generated_cases.c.h"
|
||||
#line 3877 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL_PY_WITH_DEFAULTS) {
|
||||
|
@ -3876,7 +3881,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
uint32_t func_version = read_u32(&next_instr[1].cache);
|
||||
#line 2727 "Python/bytecodes.c"
|
||||
#line 2732 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
DEOPT_IF(tstate->interp->eval_frame, CALL);
|
||||
int is_meth = method != NULL;
|
||||
|
@ -3912,7 +3917,7 @@
|
|||
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
|
||||
frame->return_offset = 0;
|
||||
DISPATCH_INLINED(new_frame);
|
||||
#line 3916 "Python/generated_cases.c.h"
|
||||
#line 3921 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL_NO_KW_TYPE_1) {
|
||||
|
@ -3920,7 +3925,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *null = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2765 "Python/bytecodes.c"
|
||||
#line 2770 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 1);
|
||||
DEOPT_IF(null != NULL, CALL);
|
||||
|
@ -3930,7 +3935,7 @@
|
|||
res = Py_NewRef(Py_TYPE(obj));
|
||||
Py_DECREF(obj);
|
||||
Py_DECREF(&PyType_Type); // I.e., callable
|
||||
#line 3934 "Python/generated_cases.c.h"
|
||||
#line 3939 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -3943,7 +3948,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *null = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2777 "Python/bytecodes.c"
|
||||
#line 2782 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 1);
|
||||
DEOPT_IF(null != NULL, CALL);
|
||||
|
@ -3954,7 +3959,7 @@
|
|||
Py_DECREF(arg);
|
||||
Py_DECREF(&PyUnicode_Type); // I.e., callable
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 3958 "Python/generated_cases.c.h"
|
||||
#line 3963 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -3968,7 +3973,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *null = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2791 "Python/bytecodes.c"
|
||||
#line 2796 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 1);
|
||||
DEOPT_IF(null != NULL, CALL);
|
||||
|
@ -3979,7 +3984,7 @@
|
|||
Py_DECREF(arg);
|
||||
Py_DECREF(&PyTuple_Type); // I.e., tuple
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 3983 "Python/generated_cases.c.h"
|
||||
#line 3988 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -3993,7 +3998,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2805 "Python/bytecodes.c"
|
||||
#line 2810 "Python/bytecodes.c"
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
if (is_meth) {
|
||||
|
@ -4015,7 +4020,7 @@
|
|||
}
|
||||
Py_DECREF(tp);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4019 "Python/generated_cases.c.h"
|
||||
#line 4024 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4029,7 +4034,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2830 "Python/bytecodes.c"
|
||||
#line 2835 "Python/bytecodes.c"
|
||||
/* Builtin METH_O functions */
|
||||
assert(kwnames == NULL);
|
||||
int is_meth = method != NULL;
|
||||
|
@ -4057,7 +4062,7 @@
|
|||
Py_DECREF(arg);
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4061 "Python/generated_cases.c.h"
|
||||
#line 4066 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4071,7 +4076,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2861 "Python/bytecodes.c"
|
||||
#line 2866 "Python/bytecodes.c"
|
||||
/* Builtin METH_FASTCALL functions, without keywords */
|
||||
assert(kwnames == NULL);
|
||||
int is_meth = method != NULL;
|
||||
|
@ -4103,7 +4108,7 @@
|
|||
'invalid'). In those cases an exception is set, so we must
|
||||
handle it.
|
||||
*/
|
||||
#line 4107 "Python/generated_cases.c.h"
|
||||
#line 4112 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4117,7 +4122,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2896 "Python/bytecodes.c"
|
||||
#line 2901 "Python/bytecodes.c"
|
||||
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
|
@ -4149,7 +4154,7 @@
|
|||
}
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4153 "Python/generated_cases.c.h"
|
||||
#line 4158 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4163,7 +4168,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2931 "Python/bytecodes.c"
|
||||
#line 2936 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
/* len(o) */
|
||||
int is_meth = method != NULL;
|
||||
|
@ -4188,7 +4193,7 @@
|
|||
Py_DECREF(callable);
|
||||
Py_DECREF(arg);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4192 "Python/generated_cases.c.h"
|
||||
#line 4197 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4201,7 +4206,7 @@
|
|||
PyObject *callable = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 2958 "Python/bytecodes.c"
|
||||
#line 2963 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
/* isinstance(o, o2) */
|
||||
int is_meth = method != NULL;
|
||||
|
@ -4228,7 +4233,7 @@
|
|||
Py_DECREF(cls);
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4232 "Python/generated_cases.c.h"
|
||||
#line 4237 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4240,7 +4245,7 @@
|
|||
PyObject **args = (stack_pointer - oparg);
|
||||
PyObject *self = stack_pointer[-(1 + oparg)];
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
#line 2988 "Python/bytecodes.c"
|
||||
#line 2993 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 1);
|
||||
assert(method != NULL);
|
||||
|
@ -4258,14 +4263,14 @@
|
|||
JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1);
|
||||
assert(next_instr[-1].op.code == POP_TOP);
|
||||
DISPATCH();
|
||||
#line 4262 "Python/generated_cases.c.h"
|
||||
#line 4267 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) {
|
||||
PyObject **args = (stack_pointer - oparg);
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 3008 "Python/bytecodes.c"
|
||||
#line 3013 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
|
@ -4296,7 +4301,7 @@
|
|||
Py_DECREF(arg);
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4300 "Python/generated_cases.c.h"
|
||||
#line 4305 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4309,7 +4314,7 @@
|
|||
PyObject **args = (stack_pointer - oparg);
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 3042 "Python/bytecodes.c"
|
||||
#line 3047 "Python/bytecodes.c"
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
if (is_meth) {
|
||||
|
@ -4338,7 +4343,7 @@
|
|||
}
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4342 "Python/generated_cases.c.h"
|
||||
#line 4347 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4351,7 +4356,7 @@
|
|||
PyObject **args = (stack_pointer - oparg);
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 3074 "Python/bytecodes.c"
|
||||
#line 3079 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
assert(oparg == 0 || oparg == 1);
|
||||
int is_meth = method != NULL;
|
||||
|
@ -4380,7 +4385,7 @@
|
|||
Py_DECREF(self);
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4384 "Python/generated_cases.c.h"
|
||||
#line 4389 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4393,7 +4398,7 @@
|
|||
PyObject **args = (stack_pointer - oparg);
|
||||
PyObject *method = stack_pointer[-(2 + oparg)];
|
||||
PyObject *res;
|
||||
#line 3106 "Python/bytecodes.c"
|
||||
#line 3111 "Python/bytecodes.c"
|
||||
assert(kwnames == NULL);
|
||||
int is_meth = method != NULL;
|
||||
int total_args = oparg;
|
||||
|
@ -4421,7 +4426,7 @@
|
|||
}
|
||||
Py_DECREF(callable);
|
||||
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
|
||||
#line 4425 "Python/generated_cases.c.h"
|
||||
#line 4430 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(oparg);
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
|
@ -4431,9 +4436,9 @@
|
|||
}
|
||||
|
||||
TARGET(INSTRUMENTED_CALL_FUNCTION_EX) {
|
||||
#line 3137 "Python/bytecodes.c"
|
||||
#line 3142 "Python/bytecodes.c"
|
||||
GO_TO_INSTRUCTION(CALL_FUNCTION_EX);
|
||||
#line 4437 "Python/generated_cases.c.h"
|
||||
#line 4442 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CALL_FUNCTION_EX) {
|
||||
|
@ -4442,7 +4447,7 @@
|
|||
PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))];
|
||||
PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))];
|
||||
PyObject *result;
|
||||
#line 3141 "Python/bytecodes.c"
|
||||
#line 3146 "Python/bytecodes.c"
|
||||
// DICT_MERGE is called before this opcode if there are kwargs.
|
||||
// It converts all dict subtypes in kwargs into regular dicts.
|
||||
assert(kwargs == NULL || PyDict_CheckExact(kwargs));
|
||||
|
@ -4504,14 +4509,14 @@
|
|||
}
|
||||
result = PyObject_Call(func, callargs, kwargs);
|
||||
}
|
||||
#line 4508 "Python/generated_cases.c.h"
|
||||
#line 4513 "Python/generated_cases.c.h"
|
||||
Py_DECREF(func);
|
||||
Py_DECREF(callargs);
|
||||
Py_XDECREF(kwargs);
|
||||
#line 3203 "Python/bytecodes.c"
|
||||
#line 3208 "Python/bytecodes.c"
|
||||
assert(PEEK(3 + (oparg & 1)) == NULL);
|
||||
if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; }
|
||||
#line 4515 "Python/generated_cases.c.h"
|
||||
#line 4520 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(((oparg & 1) ? 1 : 0));
|
||||
STACK_SHRINK(2);
|
||||
stack_pointer[-1] = result;
|
||||
|
@ -4526,7 +4531,7 @@
|
|||
PyObject *kwdefaults = (oparg & 0x02) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0))] : NULL;
|
||||
PyObject *defaults = (oparg & 0x01) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x01) ? 1 : 0))] : NULL;
|
||||
PyObject *func;
|
||||
#line 3213 "Python/bytecodes.c"
|
||||
#line 3218 "Python/bytecodes.c"
|
||||
|
||||
PyFunctionObject *func_obj = (PyFunctionObject *)
|
||||
PyFunction_New(codeobj, GLOBALS());
|
||||
|
@ -4555,14 +4560,14 @@
|
|||
|
||||
func_obj->func_version = ((PyCodeObject *)codeobj)->co_version;
|
||||
func = (PyObject *)func_obj;
|
||||
#line 4559 "Python/generated_cases.c.h"
|
||||
#line 4564 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0));
|
||||
stack_pointer[-1] = func;
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(RETURN_GENERATOR) {
|
||||
#line 3244 "Python/bytecodes.c"
|
||||
#line 3249 "Python/bytecodes.c"
|
||||
assert(PyFunction_Check(frame->f_funcobj));
|
||||
PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
|
||||
PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func);
|
||||
|
@ -4583,7 +4588,7 @@
|
|||
frame = cframe.current_frame = prev;
|
||||
_PyFrame_StackPush(frame, (PyObject *)gen);
|
||||
goto resume_frame;
|
||||
#line 4587 "Python/generated_cases.c.h"
|
||||
#line 4592 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(BUILD_SLICE) {
|
||||
|
@ -4591,15 +4596,15 @@
|
|||
PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))];
|
||||
PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))];
|
||||
PyObject *slice;
|
||||
#line 3267 "Python/bytecodes.c"
|
||||
#line 3272 "Python/bytecodes.c"
|
||||
slice = PySlice_New(start, stop, step);
|
||||
#line 4597 "Python/generated_cases.c.h"
|
||||
#line 4602 "Python/generated_cases.c.h"
|
||||
Py_DECREF(start);
|
||||
Py_DECREF(stop);
|
||||
Py_XDECREF(step);
|
||||
#line 3269 "Python/bytecodes.c"
|
||||
#line 3274 "Python/bytecodes.c"
|
||||
if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; }
|
||||
#line 4603 "Python/generated_cases.c.h"
|
||||
#line 4608 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(((oparg == 3) ? 1 : 0));
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = slice;
|
||||
|
@ -4610,7 +4615,7 @@
|
|||
PyObject *fmt_spec = ((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? stack_pointer[-((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))] : NULL;
|
||||
PyObject *value = stack_pointer[-(1 + (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))];
|
||||
PyObject *result;
|
||||
#line 3273 "Python/bytecodes.c"
|
||||
#line 3278 "Python/bytecodes.c"
|
||||
/* Handles f-string value formatting. */
|
||||
PyObject *(*conv_fn)(PyObject *);
|
||||
int which_conversion = oparg & FVC_MASK;
|
||||
|
@ -4645,7 +4650,7 @@
|
|||
Py_DECREF(value);
|
||||
Py_XDECREF(fmt_spec);
|
||||
if (result == NULL) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; }
|
||||
#line 4649 "Python/generated_cases.c.h"
|
||||
#line 4654 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0));
|
||||
stack_pointer[-1] = result;
|
||||
DISPATCH();
|
||||
|
@ -4654,10 +4659,10 @@
|
|||
TARGET(COPY) {
|
||||
PyObject *bottom = stack_pointer[-(1 + (oparg-1))];
|
||||
PyObject *top;
|
||||
#line 3310 "Python/bytecodes.c"
|
||||
#line 3315 "Python/bytecodes.c"
|
||||
assert(oparg > 0);
|
||||
top = Py_NewRef(bottom);
|
||||
#line 4661 "Python/generated_cases.c.h"
|
||||
#line 4666 "Python/generated_cases.c.h"
|
||||
STACK_GROW(1);
|
||||
stack_pointer[-1] = top;
|
||||
DISPATCH();
|
||||
|
@ -4669,7 +4674,7 @@
|
|||
PyObject *rhs = stack_pointer[-1];
|
||||
PyObject *lhs = stack_pointer[-2];
|
||||
PyObject *res;
|
||||
#line 3315 "Python/bytecodes.c"
|
||||
#line 3320 "Python/bytecodes.c"
|
||||
#if ENABLE_SPECIALIZATION
|
||||
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
|
||||
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
|
||||
|
@ -4684,12 +4689,12 @@
|
|||
assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops));
|
||||
assert(binary_ops[oparg]);
|
||||
res = binary_ops[oparg](lhs, rhs);
|
||||
#line 4688 "Python/generated_cases.c.h"
|
||||
#line 4693 "Python/generated_cases.c.h"
|
||||
Py_DECREF(lhs);
|
||||
Py_DECREF(rhs);
|
||||
#line 3330 "Python/bytecodes.c"
|
||||
#line 3335 "Python/bytecodes.c"
|
||||
if (res == NULL) goto pop_2_error;
|
||||
#line 4693 "Python/generated_cases.c.h"
|
||||
#line 4698 "Python/generated_cases.c.h"
|
||||
STACK_SHRINK(1);
|
||||
stack_pointer[-1] = res;
|
||||
next_instr += 1;
|
||||
|
@ -4699,16 +4704,16 @@
|
|||
TARGET(SWAP) {
|
||||
PyObject *top = stack_pointer[-1];
|
||||
PyObject *bottom = stack_pointer[-(2 + (oparg-2))];
|
||||
#line 3335 "Python/bytecodes.c"
|
||||
#line 3340 "Python/bytecodes.c"
|
||||
assert(oparg >= 2);
|
||||
#line 4705 "Python/generated_cases.c.h"
|
||||
#line 4710 "Python/generated_cases.c.h"
|
||||
stack_pointer[-1] = bottom;
|
||||
stack_pointer[-(2 + (oparg-2))] = top;
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_INSTRUCTION) {
|
||||
#line 3339 "Python/bytecodes.c"
|
||||
#line 3344 "Python/bytecodes.c"
|
||||
int next_opcode = _Py_call_instrumentation_instruction(
|
||||
tstate, frame, next_instr-1);
|
||||
if (next_opcode < 0) goto error;
|
||||
|
@ -4720,26 +4725,26 @@
|
|||
assert(next_opcode > 0 && next_opcode < 256);
|
||||
opcode = next_opcode;
|
||||
DISPATCH_GOTO();
|
||||
#line 4724 "Python/generated_cases.c.h"
|
||||
#line 4729 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_JUMP_FORWARD) {
|
||||
#line 3353 "Python/bytecodes.c"
|
||||
#line 3358 "Python/bytecodes.c"
|
||||
INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP);
|
||||
#line 4730 "Python/generated_cases.c.h"
|
||||
#line 4735 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_JUMP_BACKWARD) {
|
||||
#line 3357 "Python/bytecodes.c"
|
||||
#line 3362 "Python/bytecodes.c"
|
||||
INSTRUMENTED_JUMP(next_instr-1, next_instr-oparg, PY_MONITORING_EVENT_JUMP);
|
||||
#line 4737 "Python/generated_cases.c.h"
|
||||
#line 4742 "Python/generated_cases.c.h"
|
||||
CHECK_EVAL_BREAKER();
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) {
|
||||
#line 3362 "Python/bytecodes.c"
|
||||
#line 3367 "Python/bytecodes.c"
|
||||
PyObject *cond = POP();
|
||||
int err = PyObject_IsTrue(cond);
|
||||
Py_DECREF(cond);
|
||||
|
@ -4748,12 +4753,12 @@
|
|||
assert(err == 0 || err == 1);
|
||||
int offset = err*oparg;
|
||||
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
|
||||
#line 4752 "Python/generated_cases.c.h"
|
||||
#line 4757 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) {
|
||||
#line 3373 "Python/bytecodes.c"
|
||||
#line 3378 "Python/bytecodes.c"
|
||||
PyObject *cond = POP();
|
||||
int err = PyObject_IsTrue(cond);
|
||||
Py_DECREF(cond);
|
||||
|
@ -4762,12 +4767,12 @@
|
|||
assert(err == 0 || err == 1);
|
||||
int offset = (1-err)*oparg;
|
||||
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
|
||||
#line 4766 "Python/generated_cases.c.h"
|
||||
#line 4771 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) {
|
||||
#line 3384 "Python/bytecodes.c"
|
||||
#line 3389 "Python/bytecodes.c"
|
||||
PyObject *value = POP();
|
||||
_Py_CODEUNIT *here = next_instr-1;
|
||||
int offset;
|
||||
|
@ -4779,12 +4784,12 @@
|
|||
offset = 0;
|
||||
}
|
||||
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
|
||||
#line 4783 "Python/generated_cases.c.h"
|
||||
#line 4788 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) {
|
||||
#line 3398 "Python/bytecodes.c"
|
||||
#line 3403 "Python/bytecodes.c"
|
||||
PyObject *value = POP();
|
||||
_Py_CODEUNIT *here = next_instr-1;
|
||||
int offset;
|
||||
|
@ -4796,30 +4801,30 @@
|
|||
offset = oparg;
|
||||
}
|
||||
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
|
||||
#line 4800 "Python/generated_cases.c.h"
|
||||
#line 4805 "Python/generated_cases.c.h"
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(EXTENDED_ARG) {
|
||||
#line 3412 "Python/bytecodes.c"
|
||||
#line 3417 "Python/bytecodes.c"
|
||||
assert(oparg);
|
||||
opcode = next_instr->op.code;
|
||||
oparg = oparg << 8 | next_instr->op.arg;
|
||||
PRE_DISPATCH_GOTO();
|
||||
DISPATCH_GOTO();
|
||||
#line 4811 "Python/generated_cases.c.h"
|
||||
#line 4816 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(CACHE) {
|
||||
#line 3420 "Python/bytecodes.c"
|
||||
#line 3425 "Python/bytecodes.c"
|
||||
assert(0 && "Executing a cache.");
|
||||
Py_UNREACHABLE();
|
||||
#line 4818 "Python/generated_cases.c.h"
|
||||
#line 4823 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
||||
TARGET(RESERVED) {
|
||||
#line 3425 "Python/bytecodes.c"
|
||||
#line 3430 "Python/bytecodes.c"
|
||||
assert(0 && "Executing RESERVED instruction.");
|
||||
Py_UNREACHABLE();
|
||||
#line 4825 "Python/generated_cases.c.h"
|
||||
#line 4830 "Python/generated_cases.c.h"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue