• Guido van Rossum's avatar
    Trent Mick: · c682140d
    Guido van Rossum yazdı
    Fix the string methods that implement slice-like semantics with
    optional args (count, find, endswith, etc.) to properly handle
    indeces outside [INT_MIN, INT_MAX]. Previously the "i" formatter
    for PyArg_ParseTuple was used to get the indices. These could overflow.
    
    This patch changes the string methods to use the "O&" formatter with
    the slice_index() function from ceval.c which is used to do the same
    job for Python code slices (e.g. 'abcabcabc'[0:1000000000L]). slice_index()
    is renamed _PyEval_SliceIndex() and is now exported. As well, the return
    values for success/fail were changed to make slice_index directly
    usable as required by the "O&" formatter.
    
    [GvR: shouldn't a similar patch be applied to unicodeobject.c?]
    c682140d
Adı
Son kayıt (commit)
Son güncelleme
BeOS Loading commit data...
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...