summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-05 13:26:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-05 13:26:07 (GMT)
commit00d8db42fc66dcdf241a02909afc24baff9b2231 (patch)
tree2d532e173e73094a331170ac40d7147163bb49c1
parent731a9a73cd8afcf688c7733260be9431a95caece (diff)
downloadtcl-no_shimmer_string_length.zip
tcl-no_shimmer_string_length.tar.gz
tcl-no_shimmer_string_length.tar.bz2
fix broken lset tests, now all test-cases pass!no_shimmer_string_length
-rw-r--r--generic/tclListObj.c25
-rw-r--r--generic/tclStringObj.c2
2 files changed, 11 insertions, 16 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index a6985e0..2da3d85 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -1448,10 +1448,6 @@ TclLsetFlat(
* of all containing lists.
*/
- if ((objPtr)->internalRep.twoPtrValue.ptr2) {
- ckfree((objPtr)->internalRep.twoPtrValue.ptr2);
- (objPtr)->internalRep.twoPtrValue.ptr2 = NULL;
- }
Tcl_InvalidateStringRep(objPtr);
}
@@ -1643,11 +1639,10 @@ FreeListInternalRep(
ckfree((char *) listRepPtr);
}
- if (listPtr->internalRep.twoPtrValue.ptr2) {
- ckfree(listPtr->internalRep.twoPtrValue.ptr2);
- listPtr->internalRep.twoPtrValue.ptr2 = NULL;
- }
-
+ if (listPtr->internalRep.twoPtrValue.ptr2) {
+ ckfree(listPtr->internalRep.twoPtrValue.ptr2);
+ listPtr->internalRep.twoPtrValue.ptr2 = NULL;
+ }
listPtr->typePtr = NULL;
}
@@ -1798,12 +1793,12 @@ SetListFromAny(
listRepPtr->elemCount = elemPtrs - &listRepPtr->elements;
}
- /* If previous objType was string, keep the internal representation */
- if (objPtr->typePtr == &tclStringType) {
- stringIntRep = objPtr->internalRep.twoPtrValue.ptr1;
- } else {
- TclFreeIntRep(objPtr);
- }
+ /* If previous objType was string, keep the internal representation */
+ if (objPtr->typePtr == &tclStringType) {
+ stringIntRep = objPtr->internalRep.twoPtrValue.ptr1;
+ } else {
+ TclFreeIntRep(objPtr);
+ }
ListSetIntRep(objPtr, listRepPtr);
objPtr->internalRep.twoPtrValue.ptr2 = stringIntRep;
return TCL_OK;
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index b3937e2..ddfd78b 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -417,7 +417,7 @@ Tcl_GetCharLength(
Tcl_ObjType *prevtype = objPtr->typePtr;
void *prevdata = objPtr->internalRep.twoPtrValue.ptr1;
- (void)Tcl_GetString(objPtr);
+ (void)TclGetString(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = objPtr->internalRep.twoPtrValue.ptr2;
objPtr->typePtr = objPtr->internalRep.twoPtrValue.ptr1 ? &tclStringType: NULL;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;