diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclExecute.c | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2008-02-04 Miguel Sofer <msofer@users.sf.net> + + * generic/tclExecute.c (INST_CONCAT1): fix optimisation for + in-place concatenation (was going over String type) + 2008-02-04 Don Porter <dgp@users.sourceforge.net> *** 8.5.1 TAGGED FOR RELEASE *** 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 { |