Commit f0735cb9 authored by Mark Dickinson's avatar Mark Dickinson

Issue #9530: Fix undefined behaviour due to signed overflow in testcapi_long.h.

parent 3c7267be
......@@ -33,8 +33,7 @@ TESTNAME(PyObject *error(const char*))
unsigned TYPENAME uin, uout;
/* For 0, 1, 2 use base; for 3, 4, 5 use -base */
uin = j < 3 ? base
: (unsigned TYPENAME)(-(TYPENAME)base);
uin = j < 3 ? base : 0U - base;
/* For 0 & 3, subtract 1.
* For 1 & 4, leave alone.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment