Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r78380:90e5ecacb270 Date: 2015-07-01 14:38 +0200 http://bitbucket.org/pypy/pypy/changeset/90e5ecacb270/
Log: Don't use 'rffi.cast(rffi.UINT, pointer)'! This casts to a 32-bit integer, not a full machine-word integer. diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py --- a/pypy/module/_ssl/interp_ssl.py +++ b/pypy/module/_ssl/interp_ssl.py @@ -136,7 +136,7 @@ def __init__(self, ctx, protos): self.protos = protos self.buf, self.pinned, self.is_raw = rffi.get_nonmovingbuffer(protos) - NPN_STORAGE.set(r_uint(rffi.cast(rffi.UINT, self.buf)), self) + NPN_STORAGE.set(rffi.cast(lltype.Unsigned, self.buf), self) # set both server and client callbacks, because the context # can be used to create both types of sockets @@ -151,7 +151,7 @@ @staticmethod def advertiseNPN_cb(s, data_ptr, len_ptr, args): - npn = NPN_STORAGE.get(r_uint(rffi.cast(rffi.UINT, args))) + npn = NPN_STORAGE.get(rffi.cast(lltype.Unsigned, args)) if npn and npn.protos: data_ptr[0] = npn.buf len_ptr[0] = rffi.cast(rffi.UINT, len(npn.protos)) @@ -163,7 +163,7 @@ @staticmethod def selectNPN_cb(s, out_ptr, outlen_ptr, server, server_len, args): - npn = NPN_STORAGE.get(r_uint(rffi.cast(rffi.UINT, args))) + npn = NPN_STORAGE.get(rffi.cast(lltype.Unsigned, args)) if npn and npn.protos: client = npn.buf client_len = len(npn.protos) @@ -182,7 +182,7 @@ def __init__(self, ctx, protos): self.protos = protos self.buf, self.pinned, self.is_raw = rffi.get_nonmovingbuffer(protos) - ALPN_STORAGE.set(r_uint(rffi.cast(rffi.UINT, self.buf)), self) + ALPN_STORAGE.set(rffi.cast(lltype.Unsigned, self.buf), self) with rffi.scoped_str2charp(protos) as protos_buf: if libssl_SSL_CTX_set_alpn_protos( @@ -197,7 +197,7 @@ @staticmethod def selectALPN_cb(s, out_ptr, outlen_ptr, client, client_len, args): - alpn = ALPN_STORAGE.get(r_uint(rffi.cast(rffi.UINT, args))) + alpn = ALPN_STORAGE.get(rffi.cast(lltype.Unsigned, args)) if alpn and alpn.protos: server = alpn.buf server_len = len(alpn.protos) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit