summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/codecs.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-17 17:13:34 (GMT)
committerGitHub <noreply@github.com>2020-04-17 17:13:34 (GMT)
commitd7c657d4b121164caa439253da5266b2e29a1bed (patch)
treedf3c97b7bb9290d15ff7d598f36ff089cbbdbcb5 /Objects/stringlib/codecs.h
parent1a1bd2e23871619adc1405e1cdc7c1e61252fd2c (diff)
downloadcpython-d7c657d4b121164caa439253da5266b2e29a1bed.zip
cpython-d7c657d4b121164caa439253da5266b2e29a1bed.tar.gz
cpython-d7c657d4b121164caa439253da5266b2e29a1bed.tar.bz2
bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572)
Diffstat (limited to 'Objects/stringlib/codecs.h')
-rw-r--r--Objects/stringlib/codecs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index 208e8fe..9b2a29b 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -743,7 +743,7 @@ STRINGLIB(SWAB4)(STRINGLIB_CHAR ch)
return (word << 24);
#elif STRINGLIB_SIZEOF_CHAR == 2
/* high bytes are zero */
- return ((word & 0x00FFu) << 24) + ((word & 0xFF00u) << 8);
+ return ((word & 0x00FFu) << 24) | ((word & 0xFF00u) << 8);
#else
return _Py_bswap32(word);
#endif