summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-04-25 22:37:21 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-04-25 22:37:21 (GMT)
commit3065093bb3798b6a4491f9c4a3bb6c10724a143b (patch)
tree5a611f8ce9517b45214acd1390be843a02e5fba5 /Objects/longobject.c
parentaed97733df4b00d47cf1d48779fb840e029c4181 (diff)
downloadcpython-3065093bb3798b6a4491f9c4a3bb6c10724a143b.zip
cpython-3065093bb3798b6a4491f9c4a3bb6c10724a143b.tar.gz
cpython-3065093bb3798b6a4491f9c4a3bb6c10724a143b.tar.bz2
long_to_decimal_string() and _PyLong_Format() check the consistency of newly
created strings using _PyUnicode_CheckConsistency() in debug mode
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 3630ae4..74c59c7 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1657,6 +1657,7 @@ long_to_decimal_string(PyObject *aa)
/* 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 @@ _PyLong_Format(PyObject *aa, int base)
if (negative)
*--p = '-';
assert(p == PyUnicode_1BYTE_DATA(v));
+ assert(_PyUnicode_CheckConsistency(v, 1));
return v;
}