]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Teach Python/ceval.c's inlining of 'str += str' about Py_ssize_t sizes; this
authorThomas Wouters <thomas@python.org>
Wed, 19 Apr 2006 15:09:44 +0000 (15:09 +0000)
committerThomas Wouters <thomas@python.org>
Wed, 19 Apr 2006 15:09:44 +0000 (15:09 +0000)
was having funny effects when called on >2Gb strings ;P

Python/ceval.c

index 4a5882cd769120579df8baff443103be48079d07..c0d87a541321063320e027fb66abfb4a0144cc3a 100644 (file)
@@ -4238,8 +4238,8 @@ string_concatenate(PyObject *v, PyObject *w,
                /* Now we own the last reference to 'v', so we can resize it
                 * in-place.
                 */
-               int v_len = PyString_GET_SIZE(v);
-               int w_len = PyString_GET_SIZE(w);
+               Py_ssize_t v_len = PyString_GET_SIZE(v);
+               Py_ssize_t w_len = PyString_GET_SIZE(w);
                if (_PyString_Resize(&v, v_len + w_len) != 0) {
                        /* XXX if _PyString_Resize() fails, 'v' has been
                         * deallocated so it cannot be put back into 'variable'.