summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-02-04 19:54:33 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-02-04 19:54:33 (GMT)
commit8de616ebaa9b5992be55b8d4c3af38f1b88b6faa (patch)
tree3003e65a089e29d8c1bcf00bdd20e500dc9cf2a7 /generic
parent6840471c4e85cee7fa1a5255959225e8b34e941a (diff)
downloadtcl-8de616ebaa9b5992be55b8d4c3af38f1b88b6faa.zip
tcl-8de616ebaa9b5992be55b8d4c3af38f1b88b6faa.tar.gz
tcl-8de616ebaa9b5992be55b8d4c3af38f1b88b6faa.tar.bz2
* generic/tclExecute.c (INST_CONCAT1): fix optimisation for
in-place concatenation (was going over String type)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 726b585..3439fc8 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.361 2008/01/23 21:21:31 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.362 2008/02/04 19:54:34 msofer Exp $
*/
#include "tclInt.h"
@@ -2059,8 +2059,11 @@ TclExecuteByteCode(
objResultPtr = OBJ_AT_DEPTH(opnd-1);
bytes = TclGetStringFromObj(objResultPtr, &length);
#if !TCL_COMPILE_DEBUG
- if (!Tcl_IsShared(objResultPtr)) {
- Tcl_SetObjLength(objResultPtr, (length + appendLen));
+ if (bytes != tclEmptyStringRep && !Tcl_IsShared(objResultPtr)) {
+ TclFreeIntRep(objResultPtr);
+ objResultPtr->typePtr = NULL;
+ objResultPtr->bytes = ckrealloc(bytes, (length + appendLen + 1));
+ objResultPtr->length = length + appendLen;
p = TclGetString(objResultPtr) + length;
currPtr = &OBJ_AT_DEPTH(opnd - 2);
} else {