From: Victor Stinner Date: Fri, 17 Apr 2020 17:13:34 +0000 (+0200) Subject: bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572) X-Git-Tag: v3.9.0a6~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7c657d4b121164caa439253da5266b2e29a1bed;p=thirdparty%2FPython%2Fcpython.git bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572) --- diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index 208e8fe4a48b..9b2a29ba3b8c 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