This was quite a dark bug in my recent in-place string concatenation

hack: it would resize *interned* strings in-place!  This occurred because
their reference counts do not have their expected value -- stringobject.c
hacks them.  Mea culpa.
This commit is contained in:
Armin Rigo 2004-08-07 20:58:32 +00:00
parent 25847813c1
commit 618fbf5469
2 changed files with 3 additions and 2 deletions

View file

@ -4253,7 +4253,7 @@ string_concatenate(PyObject *v, PyObject *w,
}
}
if (v->ob_refcnt == 1) {
if (v->ob_refcnt == 1 && !PyString_CHECK_INTERNED(v)) {
/* Now we own the last reference to 'v', so we can resize it
* in-place.
*/