[Python-checkins] cpython: long_to_decimal_string() and _PyLong_Format() check the consistency of newly

victor.stinner python-checkins at python.org
Thu Apr 26 00:38:36 CEST 2012


http://hg.python.org/cpython/rev/3bdcf0cab164
changeset:   76560:3bdcf0cab164
parent:      76558:5fea362b92fc
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Apr 26 00:37:21 2012 +0200
summary:
  long_to_decimal_string() and _PyLong_Format() check the consistency of newly
created strings using _PyUnicode_CheckConsistency() in debug mode

files:
  Objects/longobject.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Objects/longobject.c b/Objects/longobject.c
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1657,6 +1657,7 @@
 
     /* check we've counted correctly */
     assert(p == PyUnicode_1BYTE_DATA(str));
+    assert(_PyUnicode_CheckConsistency(str, 1));
     Py_DECREF(scratch);
     return (PyObject *)str;
 }
@@ -1761,6 +1762,7 @@
     if (negative)
         *--p = '-';
     assert(p == PyUnicode_1BYTE_DATA(v));
+    assert(_PyUnicode_CheckConsistency(v, 1));
     return v;
 }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list