File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,11 @@ test_k_code(PyObject *self, PyObject *Py_UNUSED(ignored))
345
345
}
346
346
347
347
unsigned long value = PyLong_AsUnsignedLongMask (num );
348
- if (value != ULONG_MAX ) {
348
+ if (value == (unsigned long )-1 && PyErr_Occurred ()) {
349
+ Py_DECREF (num );
350
+ goto error ;
351
+ }
352
+ else if (value != ULONG_MAX ) {
349
353
Py_DECREF (num );
350
354
PyErr_SetString (PyExc_AssertionError ,
351
355
"test_k_code: "
@@ -376,7 +380,12 @@ test_k_code(PyObject *self, PyObject *Py_UNUSED(ignored))
376
380
}
377
381
378
382
value = PyLong_AsUnsignedLongMask (num );
379
- if (value != (unsigned long )-0x42 ) {
383
+ if (value == (unsigned long )-1 && PyErr_Occurred ()) {
384
+ Py_DECREF (num );
385
+ goto error ;
386
+ }
387
+ else if (value != (unsigned long )-0x42 ) {
388
+ Py_DECREF (num );
380
389
PyErr_SetString (PyExc_AssertionError ,
381
390
"test_k_code: "
382
391
"PyLong_AsUnsignedLongMask() returned wrong value for long -0xFFF..000042" );
You can’t perform that action at this time.
0 commit comments