Skip to content

Commit d7c657d

Browse files
authored
bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572)
1 parent 1a1bd2e commit d7c657d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/stringlib/codecs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ STRINGLIB(SWAB4)(STRINGLIB_CHAR ch)
743743
return (word << 24);
744744
#elif STRINGLIB_SIZEOF_CHAR == 2
745745
/* high bytes are zero */
746-
return ((word & 0x00FFu) << 24) + ((word & 0xFF00u) << 8);
746+
return ((word & 0x00FFu) << 24) | ((word & 0xFF00u) << 8);
747747
#else
748748
return _Py_bswap32(word);
749749
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy