We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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?
to your account
Here is a sample function in question:
def first_or_last(int[:] values, bint first):
cdef Py_ssize_t i
i = -1
i = 0
In both cases, i should always be initialized when used, but gcc emits something along the lines of
hello.c: In function ‘__pyx_gb_5hello_2generator’:
hello.c:2326:32: warning: ‘__pyx_t_2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
Moving the yields outside of the branches works fine, but this is a problem showing up in a larger function where I don't know that that is possible
I've attached the generated code. I think this is an issue where the generator saving the state of the function but not entirely sure
The text was updated successfully, but these errors were encountered:
The warning seems correct: that temp variable is only used in the first branch and not in the second. There is no reason why it would need to get stored away in the closure there.
It could be that some state from the first branch leaks into the second during the code generation phase, e.g. an unreleased temp variable. Needs some more debugging there.
Sorry, something went wrong.
Release temps used for buffer indexing after use
Release temps used for buffer indexing after use (GH-3517)
Successfully merging a pull request may close this issue.