[issue9020] 2.7: eval hangs on AIX

Sridhar Ratnakumar report at bugs.python.org
Fri Jun 18 22:47:29 CEST 2010


Sridhar Ratnakumar <sridharr at activestate.com> added the comment:

On 2010-06-18, at 11:47 AM, Eric Smith wrote:

> 
> Eric Smith <eric at trueblade.com> added the comment:
> 
> I suppose that's correct, although I have no way to test it.

I have tested it on Linux 64-bit by running `test.regrtest`. It doesn't seem to break anything.

> I haven't spent a lot of time looking at the code in tokenizer.c, but if there's a problem with sign-extending signed chars, it wouldn't surprise me if it shows up in more than one place.

My conclusive understanding of the problem: `register int` is 4 bytes in size, and this (`c`) is used without any cast as an index to the array _Py_ctype_table (in pyctype.c) ... by passing it to `Py_CHARMASK` which, if CHAR_UNSIGNED is defined (as is the case with AIX compiler), *assumes* that `c` will always be a char. And that assumption is not respected by tokenizer.c:tok_get which (indirectly) passes `register int` to this macro.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9020>
_______________________________________


More information about the Python-bugs-list mailing list