Skip to content

Dead code in CALL_FUNCTION_EX opcode handler #96751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sobolevn opened this issue Sep 11, 2022 · 1 comment
Closed

Dead code in CALL_FUNCTION_EX opcode handler #96751

sobolevn opened this issue Sep 11, 2022 · 1 comment
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

I am talking about these lines:

cpython/Python/ceval.c

Lines 4722 to 4734 in a36235d

if (!PyDict_CheckExact(kwargs)) {
PyObject *d = PyDict_New();
if (d == NULL)
goto error;
if (_PyDict_MergeEx(d, kwargs, 2) < 0) {
Py_DECREF(d);
format_kwargs_error(tstate, SECOND(), kwargs);
Py_DECREF(kwargs);
goto error;
}
Py_DECREF(kwargs);
kwargs = d;
}

They are not ever called, because after #18141 all ** dict unpacking is handled in DICT_MERGE opcode.

This was found while working on #94808 but I think that it deserves a separate issue.

PR is on its way.

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Sep 11, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Sep 11, 2022
@mdboom
Copy link
Contributor

mdboom commented Sep 11, 2022

Thanks for taking such an interest in coverage. This is very welcome (but I'll leave it to @markshannon to review the specific change in #96752).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants