]> granicus.if.org Git - python/commitdiff
Py_SIZE() was misused for dict.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Jan 2017 06:38:15 +0000 (08:38 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Jan 2017 06:38:15 +0000 (08:38 +0200)
1  2 
Modules/_json.c

diff --cc Modules/_json.c
index d3fb7843cf66b70794288fc00cc411753eb91c76,faa213491b63873dabb843393fed13689f34a2fd..941f36343de4f8e39603448238ec626b57b171aa
@@@ -1609,7 -1609,7 +1609,7 @@@ encoder_listencode_dict(PyEncoderObjec
          if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
              return -1;
      }
-     if (Py_SIZE(dct) == 0)
 -    if (PyDict_Size(dct) == 0)  /* Fast path */
++    if (PyDict_GET_SIZE(dct) == 0)  /* Fast path */
          return _PyAccu_Accumulate(acc, empty_dict);
  
      if (s->markers != Py_None) {