pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.58k stars 2.09k forks source link

During exception handling check if it is not null before using #4814

Closed oleksandr-pavlyk closed 1 year ago

oleksandr-pavlyk commented 1 year ago

Description

Coverity tool flags use of "it->signature" citing that it could be a nullptr.

image

I suppose the thinking was that exception can only arise within the loop (so it is not null per loop termination condition), but perhaps it is better to be safe.

Suggested changelog entry:

None.

oleksandr-pavlyk commented 1 year ago

So what's next? Should I close this PR without merging since this issue is classified as a False positive?

rwgk commented 1 year ago

Sorry I've been very busy. I need to find a few minutes to finish up my PR with the variable name change and the assert(). Will do asap. (I can close this PR then or you can close it now.)

rwgk commented 1 year ago

4817 was merged. Thanks @oleksandr-pavlyk for trying it out!