Skip to content

gh-135513: Fix unused variable warning in crossinterp.c #135514

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jun 14, 2025

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's undeclared now at line 2664 I think

@sobolevn sobolevn added the needs backport to 3.14 bugs and security fixes label Jun 14, 2025
@sobolevn
Copy link
Member Author

@picnixz I want to be sure that tstate does not change between these calls, because we can see that some other parts of this code changes tstate. So, maybe it is not safe to inline these calls like that? Let's be extra careful and use #ifdef instead 🤔

@picnixz
Copy link
Member

picnixz commented Jun 15, 2025

I want to be sure that tstate does not change between these calls, because we can see that some other parts of this code changes tstate

I also thought about it but ISTM that the following wouldn't make sense otherwise:

PyThreadState *tstate = _PyThreadState_GET();
...
if (_fill_sharedns(sharedns, nsupdates, fallback, &_err) < 0) {
    assert(_PyErr_Occurred(tstate));
    ...
}

But it's a good idea to use ifdefs just for that. We can also ask @ericsnowcurrently if our analysis is correct

@sobolevn
Copy link
Member Author

I went with the safest bet: #ifndef NDEBUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants