You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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.
Here is a sample function in question:
In both cases,
i
should always be initialized when used, but gcc emits something along the lines ofMoving 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
hello.c.zip
The text was updated successfully, but these errors were encountered: