mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Vladimir Marangozov:
This patch fixes a problem on AIX with the signed int case code in getargs.c, after Trent Mick's intervention about MIN/MAX overflow checks. The AIX compiler/optimizer generates bogus code with the default flags "-g -O" causing test_builtin to fail: int("10", 16) <> 16L. Swapping the two checks in the signed int code makes the problem go away. Also, make the error messages fit in 80 char lines in the source.
This commit is contained in:
parent
d7823f2645
commit
5e08cb8e50
1 changed files with 10 additions and 10 deletions
|
@ -513,16 +513,16 @@ convertsimple1(arg, p_format, p_va)
|
|||
long ival = PyInt_AsLong(arg);
|
||||
if (ival == -1 && PyErr_Occurred())
|
||||
return "integer<i>";
|
||||
else if (ival < INT_MIN) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"signed integer is less than minimum");
|
||||
return "integer<i>";
|
||||
}
|
||||
else if (ival > INT_MAX) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"signed integer is greater than maximum");
|
||||
return "integer<i>";
|
||||
}
|
||||
else if (ival < INT_MIN) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"signed integer is less than minimum");
|
||||
return "integer<i>";
|
||||
}
|
||||
else
|
||||
*p = ival;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue