mirror of https://github.com/python/cpython
bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572)
This commit is contained in:
parent
1a1bd2e238
commit
d7c657d4b1
|
@ -743,7 +743,7 @@ STRINGLIB(SWAB4)(STRINGLIB_CHAR ch)
|
||||||
return (word << 24);
|
return (word << 24);
|
||||||
#elif STRINGLIB_SIZEOF_CHAR == 2
|
#elif STRINGLIB_SIZEOF_CHAR == 2
|
||||||
/* high bytes are zero */
|
/* high bytes are zero */
|
||||||
return ((word & 0x00FFu) << 24) + ((word & 0xFF00u) << 8);
|
return ((word & 0x00FFu) << 24) | ((word & 0xFF00u) << 8);
|
||||||
#else
|
#else
|
||||||
return _Py_bswap32(word);
|
return _Py_bswap32(word);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue