Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb9ea8c

Browse files
author
Victor Stinner
committed
Don't check for the maximum character when copying from unicodeobject.c
* Create copy_characters() function which doesn't check for the maximum character in release mode * _PyUnicode_CheckConsistency() is no more static to be able to use it in _PyUnicode_FormatAdvanced() (in formatter_unicode.c) * _PyUnicode_CheckConsistency() checks the string hash
1 parent 05d1189 commit fb9ea8c

3 files changed

Lines changed: 198 additions & 193 deletions

File tree

Include/unicodeobject.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,13 @@ PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
20302030
);
20312031
#endif /* Py_LIMITED_API */
20322032

2033+
#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
2034+
/* FIXME: use PyObject* type for op */
2035+
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
2036+
void *op,
2037+
int check_content);
2038+
#endif
2039+
20332040
#ifdef __cplusplus
20342041
}
20352042
#endif

0 commit comments

Comments
 (0)