summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-04-28 17:06:05 (GMT)
committerstanton <stanton@noemail.net>1999-04-28 17:06:05 (GMT)
commitac2f29e9de837f1217245f071596b60ec967ed8a (patch)
tree856e7536adf9af9ca2fbd629f5843a04f50f9e00 /generic
parent0496953560ce209d6660d2cc3baaf2b4658247f7 (diff)
downloadtcl-ac2f29e9de837f1217245f071596b60ec967ed8a.zip
tcl-ac2f29e9de837f1217245f071596b60ec967ed8a.tar.gz
tcl-ac2f29e9de837f1217245f071596b60ec967ed8a.tar.bz2
* mac/tclMacResource.c:
* generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Changed to avoid freeing the string representation before freeing the internal rep. This helps with debugging since the string rep will still be valid when the free proc is invoked. FossilOrigin-Name: 101102ec64e854b9c1a05a9407a0824a7dfc0271
Diffstat (limited to 'generic')
-rw-r--r--generic/tclListObj.c4
-rw-r--r--generic/tclObj.c10
-rw-r--r--generic/tclStringObj.c14
3 files changed, 14 insertions, 14 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index aceaa7a..d4b3aba 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclListObj.c,v 1.4 1999/04/16 00:46:50 stanton Exp $
+ * RCS: @(#) $Id: tclListObj.c,v 1.5 1999/04/28 17:06:06 stanton Exp $
*/
#include "tclInt.h"
@@ -236,11 +236,11 @@ Tcl_SetListObj(objPtr, objc, objv)
* Free any old string rep and any internal rep for the old type.
*/
- Tcl_InvalidateStringRep(objPtr);
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = NULL;
+ Tcl_InvalidateStringRep(objPtr);
/*
* Set the object's type to "list" and initialize the internal rep.
diff --git a/generic/tclObj.c b/generic/tclObj.c
index c4895ee..d44b520 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.5 1999/04/16 00:46:50 stanton Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.6 1999/04/28 17:06:06 stanton Exp $
*/
#include "tclInt.h"
@@ -926,13 +926,13 @@ Tcl_SetBooleanObj(objPtr, boolValue)
panic("Tcl_SetBooleanObj called with shared object");
}
- Tcl_InvalidateStringRep(objPtr);
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.longValue = (boolValue? 1 : 0);
objPtr->typePtr = &tclBooleanType;
+ Tcl_InvalidateStringRep(objPtr);
}
/*
@@ -1284,13 +1284,13 @@ Tcl_SetDoubleObj(objPtr, dblValue)
panic("Tcl_SetDoubleObj called with shared object");
}
- Tcl_InvalidateStringRep(objPtr);
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.doubleValue = dblValue;
objPtr->typePtr = &tclDoubleType;
+ Tcl_InvalidateStringRep(objPtr);
}
/*
@@ -1552,13 +1552,13 @@ Tcl_SetIntObj(objPtr, intValue)
panic("Tcl_SetIntObj called with shared object");
}
- Tcl_InvalidateStringRep(objPtr);
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.longValue = (long) intValue;
objPtr->typePtr = &tclIntType;
+ Tcl_InvalidateStringRep(objPtr);
}
/*
@@ -1917,13 +1917,13 @@ Tcl_SetLongObj(objPtr, longValue)
panic("Tcl_SetLongObj called with shared object");
}
- Tcl_InvalidateStringRep(objPtr);
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.longValue = longValue;
objPtr->typePtr = &tclIntType;
+ Tcl_InvalidateStringRep(objPtr);
}
/*
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index c0261c7..e7d3ae7 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.4 1999/04/16 00:46:53 stanton Exp $
+ * RCS: @(#) $Id: tclStringObj.c,v 1.5 1999/04/28 17:06:06 stanton Exp $
*/
#include "tclInt.h"
@@ -222,12 +222,6 @@ Tcl_SetStringObj(objPtr, bytes, length)
panic("Tcl_SetStringObj called with shared object");
}
- Tcl_InvalidateStringRep(objPtr);
- if (length < 0) {
- length = (bytes? strlen(bytes) : 0);
- }
- TclInitStringRep(objPtr, bytes, length);
-
/*
* Set the type to NULL and free any internal rep for the old type.
*/
@@ -236,6 +230,12 @@ Tcl_SetStringObj(objPtr, bytes, length)
oldTypePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = NULL;
+
+ Tcl_InvalidateStringRep(objPtr);
+ if (length < 0) {
+ length = (bytes? strlen(bytes) : 0);
+ }
+ TclInitStringRep(objPtr, bytes, length);
}
/*