diff options
author | Armin Rigo <arigo@tunes.org> | 2004-08-07 20:58:32 (GMT) |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2004-08-07 20:58:32 (GMT) |
commit | 618fbf5469ec6b8013b00989623763db21dd0ce5 (patch) | |
tree | 038a1948057047243f99e38569ec472120f86eda /Python | |
parent | 25847813c18b500d661137364b9041c6b08a75ea (diff) | |
download | cpython-618fbf5469ec6b8013b00989623763db21dd0ce5.zip cpython-618fbf5469ec6b8013b00989623763db21dd0ce5.tar.gz cpython-618fbf5469ec6b8013b00989623763db21dd0ce5.tar.bz2 |
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.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 4dd31ab..4c9bded 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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. */ |