mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
These were reverted in gh-26530 (commit17c4edc) due to refleaks. *2c1e258- Compute deref offsets in compiler (gh-25152) *b2bf2bc- Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388) This change fixes the refleaks. https://bugs.python.org/issue43693
This commit is contained in:
parent
001eb520b5
commit
2ab27c4af4
23 changed files with 6044 additions and 5710 deletions
39
Objects/clinic/codeobject.c.h
generated
39
Objects/clinic/codeobject.c.h
generated
|
|
@ -373,4 +373,41 @@ skip_optional_kwonly:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=a272b22f63ea002e input=a9049054013a1b77]*/
|
||||
|
||||
PyDoc_STRVAR(code__varname_from_oparg__doc__,
|
||||
"_varname_from_oparg($self, /, oparg)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"(internal-only) Return the local variable name for the given oparg.\n"
|
||||
"\n"
|
||||
"WARNING: this method is for internal use only and may change or go away.");
|
||||
|
||||
#define CODE__VARNAME_FROM_OPARG_METHODDEF \
|
||||
{"_varname_from_oparg", (PyCFunction)(void(*)(void))code__varname_from_oparg, METH_FASTCALL|METH_KEYWORDS, code__varname_from_oparg__doc__},
|
||||
|
||||
static PyObject *
|
||||
code__varname_from_oparg_impl(PyCodeObject *self, int oparg);
|
||||
|
||||
static PyObject *
|
||||
code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"oparg", NULL};
|
||||
static _PyArg_Parser _parser = {NULL, _keywords, "_varname_from_oparg", 0};
|
||||
PyObject *argsbuf[1];
|
||||
int oparg;
|
||||
|
||||
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
|
||||
if (!args) {
|
||||
goto exit;
|
||||
}
|
||||
oparg = _PyLong_AsInt(args[0]);
|
||||
if (oparg == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = code__varname_from_oparg_impl(self, oparg);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=ba4c5487e0364ce8 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue