From 618fbf5469ec6b8013b00989623763db21dd0ce5 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Sat, 7 Aug 2004 20:58:32 +0000 Subject: 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. --- Python/ceval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/ceval.c b/Python/ceval.c index 4dd31ab9ba..4c9bdeda13 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. */ -- cgit v1.2.1