]> granicus.if.org Git - python/commitdiff
Merged revisions 85342 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 9 Oct 2010 15:28:59 +0000 (15:28 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 9 Oct 2010 15:28:59 +0000 (15:28 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85342 | antoine.pitrou | 2010-10-09 17:24:28 +0200 (sam., 09 oct. 2010) | 4 lines

  Issue #10055: Make json C89-compliant in UCS4 mode.
........

Misc/NEWS
Modules/_json.c

index ef981f379b01528ddc1e11962f7f7189507b85e3..41a8fd897f4526508ffcfab629a6e42a3cda5274 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -368,6 +368,8 @@ Tools/Demos
 Build
 -----
 
+- Issue #10055: Make json C89-compliant in UCS4 mode.
+
 - Issue #1633863: Don't ignore $CC under AIX.
 
 - Issue #9810: Compile bzip2 source files in python's project file
index 2ef66e3fa4ee943407dea4f30957e347d7dc3aee..d81721a00aa54bee339b128da5629d03b47218d1 100644 (file)
@@ -564,8 +564,8 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict, Py_s
                 end += 6;
                 /* Decode 4 hex digits */
                 for (; next < end; next++) {
-                    c2 <<= 4;
                     Py_UNICODE digit = buf[next];
+                    c2 <<= 4;
                     switch (digit) {
                         case '0': case '1': case '2': case '3': case '4':
                         case '5': case '6': case '7': case '8': case '9':
@@ -755,8 +755,8 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
                 end += 6;
                 /* Decode 4 hex digits */
                 for (; next < end; next++) {
-                    c2 <<= 4;
                     Py_UNICODE digit = buf[next];
+                    c2 <<= 4;
                     switch (digit) {
                         case '0': case '1': case '2': case '3': case '4':
                         case '5': case '6': case '7': case '8': case '9':