]> granicus.if.org Git - python/commitdiff
Add consistency check to _PyUnicode_New()
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 18 Oct 2011 20:10:14 +0000 (22:10 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 18 Oct 2011 20:10:14 +0000 (22:10 +0200)
Objects/unicodeobject.c

index 9d11546cb339a56e120be81b60ce9ecf4a368d13..1068916884e50438742aa1a6b4b2f096a879c428 100644 (file)
@@ -781,6 +781,7 @@ _PyUnicode_New(Py_ssize_t length)
     _PyUnicode_LENGTH(unicode) = 0;
     _PyUnicode_UTF8(unicode) = NULL;
     _PyUnicode_UTF8_LENGTH(unicode) = 0;
+    assert(_PyUnicode_CheckConsistency(unicode, 0));
     return unicode;
 
   onError: