summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-04-27 19:26:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-04-27 19:26:11 (GMT)
commitd4624cb3479e802ba0689103317303b2cb3098c7 (patch)
tree55eb219d2beadcbd910d00d1584c3becd482728d
parent6e055348266e6090d1fc58eda98de67d8a7ae8fb (diff)
parent534bec807cc2cb0a81899bdc9fe9e39a486c0ea5 (diff)
downloadtcl-d4624cb3479e802ba0689103317303b2cb3098c7.zip
tcl-d4624cb3479e802ba0689103317303b2cb3098c7.tar.gz
tcl-d4624cb3479e802ba0689103317303b2cb3098c7.tar.bz2
TclFreeIntRep() correction & cleanup.
-rw-r--r--ChangeLog10
-rw-r--r--generic/tclCmdMZ.c2
-rw-r--r--generic/tclExecute.c1
-rw-r--r--generic/tclIndexObj.c1
-rw-r--r--generic/tclInt.h7
-rw-r--r--generic/tclListObj.c1
-rw-r--r--generic/tclNamesp.c1
-rw-r--r--generic/tclResult.c1
-rw-r--r--generic/tclStringObj.c1
-rw-r--r--generic/tclVar.c2
10 files changed, 14 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index f058413..22fadc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2011-04-27 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclCmdMZ.c: TclFreeIntRep() correction & cleanup.
+ * generic/tclExecute.c:
+ * generic/tclIndexObj.c:
+ * generic/tclInt.h:
+ * generic/tclListObj.c:
+ * generic/tclNamesp.c:
+ * generic/tclResult.c:
+ * generic/tclStringObj.c:
+ * generic/tclVar.c:
+
* generic/tclListObj.c: FreeListInternalRep() cleanup.
2011-04-21 Don Porter <dgp@users.sourceforge.net>
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index a4b7d1e..e4a58ed 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1560,7 +1560,6 @@ StringIsCmd(
if (stop < end) {
result = 0;
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
}
}
break;
@@ -1617,7 +1616,6 @@ StringIsCmd(
failat = stop - string1;
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
}
} else {
/*
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index ab50256..4fe65d7 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2549,7 +2549,6 @@ TEBCresume(
#if !TCL_COMPILE_DEBUG
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;
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 99bd61f..69608cc 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -217,7 +217,6 @@ GetIndexFromObjList(
*/
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
ckfree(tablePtr);
return result;
diff --git a/generic/tclInt.h b/generic/tclInt.h
index fe06573..95a497b 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4045,9 +4045,10 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
*/
#define TclFreeIntRep(objPtr) \
- if ((objPtr)->typePtr != NULL && \
- (objPtr)->typePtr->freeIntRepProc != NULL) { \
- (objPtr)->typePtr->freeIntRepProc(objPtr); \
+ if ((objPtr)->typePtr != NULL) { \
+ if ((objPtr)->typePtr->freeIntRepProc != NULL) { \
+ (objPtr)->typePtr->freeIntRepProc(objPtr); \
+ } \
(objPtr)->typePtr = NULL; \
}
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 7d0743d..88b3a0b 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -358,7 +358,6 @@ Tcl_SetListObj(
*/
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
Tcl_InvalidateStringRep(objPtr);
/*
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 957b525..f3c93e7 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -4739,7 +4739,6 @@ SetNsNameFromAny(
if (objPtr->typePtr == &nsNameType) {
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
}
return TCL_ERROR;
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 6a71ee2..60bae73 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -989,7 +989,6 @@ ResetObjResult(
objResultPtr->length = 0;
}
TclFreeIntRep(objResultPtr);
- objResultPtr->typePtr = NULL;
}
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index fe6d0af..7f31fdf 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -757,7 +757,6 @@ Tcl_SetStringObj(
*/
TclFreeIntRep(objPtr);
- objPtr->typePtr = NULL;
/*
* Free any old string rep, then set the string rep to a copy of the
diff --git a/generic/tclVar.c b/generic/tclVar.c
index b735ba3..55c031c 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -703,7 +703,6 @@ TclObjLookupVarEx(
*/
TclFreeIntRep(part1Ptr);
- part1Ptr->typePtr = NULL;
varPtr = TclLookupSimpleVar(interp, part1Ptr, flags, createPart1,
&errMsg, &index);
@@ -2361,7 +2360,6 @@ TclPtrUnsetVar(
if (part1Ptr->typePtr == &tclNsVarNameType) {
TclFreeIntRep(part1Ptr);
- part1Ptr->typePtr = NULL;
}
#endif