diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2006-07-21 10:47:18 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2006-07-21 10:47:18 (GMT) |
commit | 7aa734510a8d4513721e66fa08ec27b72726d1a6 (patch) | |
tree | ebfd27f59af5c53eade7e31ae6b0414b8e9661e6 /generic/tclInt.h | |
parent | af031c0a09d0d4abeb4bf13bd542663126fb2245 (diff) | |
download | tcl-7aa734510a8d4513721e66fa08ec27b72726d1a6.zip tcl-7aa734510a8d4513721e66fa08ec27b72726d1a6.tar.gz tcl-7aa734510a8d4513721e66fa08ec27b72726d1a6.tar.bz2 |
* generic/tclExecute.c:
* tests/execute.test (execute-9.1): dgp's fix for [Bug 1522803].
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 35addc8..cb4a70f 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.272 2006/07/05 05:34:44 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.273 2006/07/21 10:47:19 msofer Exp $ */ #ifndef _TCLINT @@ -2624,15 +2624,20 @@ MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr); (objPtr)->length = 0; \ (objPtr)->typePtr = NULL +/* Invalidate the string rep first so we can use the bytes value \ + * for our pointer chain, and signal an obj deletion (as opposed \ + * to shimmering) with 'length == -1' */ \ + # define TclDecrRefCount(objPtr) \ if (--(objPtr)->refCount <= 0) { \ + if ((objPtr)->bytes \ + && ((objPtr)->bytes != tclEmptyStringRep)) { \ + ckfree((char *) (objPtr)->bytes); \ + } \ + (objPtr)->length = -1; \ if ((objPtr)->typePtr && (objPtr)->typePtr->freeIntRepProc) { \ TclFreeObj(objPtr); \ } else { \ - if ((objPtr)->bytes \ - && ((objPtr)->bytes != tclEmptyStringRep)) { \ - ckfree((char *) (objPtr)->bytes); \ - } \ TclFreeObjStorage(objPtr); \ TclIncrObjsFreed(); \ } \ |