Code review comment for lp:~jameinel/bzr/2.1-pyrex-64bit

Revision history for this message
John A Meinel (jameinel) wrote :

Vincent's wonderful buildbot farm caught a regression with the new code.

Namely, pyrex 0.9.8.5 treats 'hash(obj)' as though it returns an int, rather than a long. So on 64-bit machines it truncates the hash value. This was an issue because sometimes we accessed the hash directly. (Py_TYPE(obj).tp_hash(obj)).

The attached patch just changes all lookups to go through PyObject_Hash() which is defined to give a stable interface. It also means we don't have to manually do exception checking, because the return of -1 can be defined as an exception condition.

Note that pyrex 0.9.7.2 was doing the right thing here, which is why Vincent's 64-bit Ubuntu machines were not failing, but the 64-bit Freebsd machines were. (freebsd had a newer pyrex...)

« Back to merge proposal