-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix get_datetimestruct_days overflow #56001
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
Conversation
|
||
if (did_overflow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also just PD_CHECK_OVERFLOW every expression but that is potentially a lot of branching. This allows more calls to build up in a pipeline and just raises at the very end if needed
if (did_error) { | ||
return -1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is acquiring the gil, checking if an overflow happened, then releasing it? is there a nogil alternative?
id be more comfortable with this if we had a test where it made a difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GIL is only acquired when days == -1
because you need to check if that is a legitimate value or if a Python exception was thrown. This is essentially what except? -1
does in Cython
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Thanks @WillAyd |
More pre-cursor for UBSAN/ASAN