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

BUG: Initialize value of no_castable_output used in ufunc_loop_matches #18157

Merged
merged 1 commit into from
Jan 14, 2021
Merged

BUG: Initialize value of no_castable_output used in ufunc_loop_matches #18157

merged 1 commit into from
Jan 14, 2021

Conversation

alexhenrie
Copy link
Contributor

ufunc_loop_matches checks if (!(*out_no_castable_output)), but out_no_castable_output was not initialized and could be anything.

@seberg
Copy link
Member

seberg commented Jan 14, 2021

Hmm, shouldn't valgrind notice this type of thing? I am wondering if we want to add a test for it, because I do not recall valgrind ever complaining about it (I run it semi-rgularly). OTOH, the type_tuple_type_resolver is a bit obscure and not used much (it is the dtype= argument and especially signature= to ufuncs).

Maybe just going to merge this as is soon. Just curious are these PRs based on static code analysis?

@alexhenrie
Copy link
Contributor Author

I made this pull request and #18156 because of scan-build warnings. #18161 was just something I noticed while looking through the code.

@seberg
Copy link
Member

seberg commented Jan 14, 2021

Thanks, I will just merge this. It doesn't seem to fix an actual bug, but is correct.

Whether or not this causes undefined behaviour seems to not make a difference in this function (because it is used solely for error reporting, and that branch doesn't do nice error reporting). (This function is a mess, but I hope the solution is to just delete all of it in the next months.)

@seberg seberg merged commit 5c70029 into numpy:master Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants