Skip to content
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

Objects/frameobject.c lacks error-checking #118609

Closed
Eclips4 opened this issue May 5, 2024 · 3 comments
Closed

Objects/frameobject.c lacks error-checking #118609

Eclips4 opened this issue May 5, 2024 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented May 5, 2024

Bug report

Bug description:

There's a couple of moments like this:

PyObject *dct = PyDict_New();
PyObject *result = NULL;
PyDict_Update(dct, self);
result = PyObject_RichCompare(dct, other, op);
Py_DECREF(dct);

Of course, we need to add a check that dct has a non-NULL value.

However, during the build I have notice this warning:

Objects/frameobject.c:390:59: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
framelocalsproxy_values(PyObject *self, PyObject *__unused)
                                                          ^

I think it's ok to address all of these issues in one PR.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) labels May 5, 2024
@gaogaotiantian gaogaotiantian self-assigned this May 5, 2024
@Eclips4
Copy link
Member Author

Eclips4 commented May 5, 2024

To fix the warning from the compiler we need to use Py_UNUSED, i.e PyObject *__unused -> PyObject *Py_UNUSED(ignored)

@gaogaotiantian
Copy link
Member

Yeah, this is already fixed in my local PR. I'm waiting for the other one merged to create the PR to fix everything.

@gaogaotiantian
Copy link
Member

The fix is merged.

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

2 participants