-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[3.5] bpo-29960 _random.Random corrupted on exception in setstate(). … #1288
Conversation
Modules/_randommodule.c
Outdated
@@ -313,6 +313,7 @@ random_setstate(RandomObject *self, PyObject *state) | |||
int i; | |||
unsigned long element; | |||
long index; | |||
uint32_t new_state[N]; |
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.
Use PY_UINT32_T
rather than uint32_t
.
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.
Updated.
Modules/_randommodule.c
Outdated
@@ -329,7 +330,7 @@ random_setstate(RandomObject *self, PyObject *state) | |||
element = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(state, i)); | |||
if (element == (unsigned long)-1 && PyErr_Occurred()) | |||
return NULL; | |||
self->state[i] = (PY_UINT32_T)element; | |||
new_state[i] = (uint32_t)element; |
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.
Use PY_UINT32_T
rather than uint32_t
.
Codecov Report
@@ Coverage Diff @@
## 3.5 #1288 +/- ##
==========================================
+ Coverage 83.47% 83.48% +<.01%
==========================================
Files 1343 1343
Lines 335776 335780 +4
==========================================
+ Hits 280294 280312 +18
+ Misses 55482 55468 -14
Continue to review full report at Codecov.
|
df62d88
to
ec481b6
Compare
…(GH-1019).
(cherry picked from commit 9616a82)