From de6aa74101b91995aba9134c5093a6899d4da019 Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 16 Jul 2003 21:24:12 +0000 Subject: * generic/tclPreserve.c: In Result and Preserve'd routines, do not * generic/tclUtil.c: assume that ckfree == free, as that is not * generic/tclResult.c: always true. [Bug 756791] (fuller) --- ChangeLog | 44 ++++++++++++++++++++++---------------------- generic/tclPreserve.c | 8 +++----- generic/tclResult.c | 20 +++++++------------- generic/tclUtil.c | 5 ++--- 4 files changed, 34 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 461a72f..c680467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,13 @@ 2003-07-16 Don Porter - * generic/tclFileName.c (Tcl_GlobObjCmd): [Bug 771840] + * generic/tclFileName.c (Tcl_GlobObjCmd): [Bug 771840] * generic/tclPathObj.c (Tcl_FSConvertToPathType):[Bug 771947] - * unix/tclUnixFCmd.c (GetModeFromPermString): [Bug 771949] + * unix/tclUnixFCmd.c (GetModeFromPermString): [Bug 771949] Silence compiler warnings about unreached lines. - * library/tcltest/tcltest.tcl (ProcessFlags): Corrected broken call - * library/tcltest/pkgIndex.tcl: to [lrange]. Bumped - to version 2.2.4. [Bug 772333] + * library/tcltest/tcltest.tcl (ProcessFlags): Corrected broken call + * library/tcltest/pkgIndex.tcl: to [lrange]. Bumped + to version 2.2.4. [Bug 772333] 2003-07-15 Mo DeJong @@ -23,9 +23,9 @@ * doc/http.n: Updated SYNOPSIS to match actual syntax of commands. [Bug 756112] - * unix/dltest/pkga.c: Updated to not use Tcl_UtfNcmp and counted - strings instead of strcmp (not defined in any #include'd header) - and presumed NULL-terminated strings. + * unix/dltest/pkga.c: Updated to not use Tcl_UtfNcmp and counted + strings instead of strcmp (not defined in any #include'd header) + and presumed NULL-terminated strings. * generic/tclCompCmds.c (TclCompileIfCmd): Prior fix of Bug 711371 on 2003-04-07 introduced a buffer overflow. Corrected. [Bug 771613] @@ -90,10 +90,10 @@ 2003-06-27 Don Porter - * tests/init.test: Added [cleanupTests] to report results of tests - * tests/pkg.test: that run in slave interps. [Bugs 761334,761344] + * tests/init.test: Added [cleanupTests] to report results of tests + * tests/pkg.test: that run in slave interps. [Bugs 761334,761344] - * tests/http.test: Used more reliable path to find httpd script. + * tests/http.test: Used more reliable path to find httpd script. 2003-06-25 Don Porter @@ -219,9 +219,9 @@ 2003-06-04 Joe Mistachkin - * tools/man2help.tcl: Added duplicate help section checking - * tools/index.tcl: and corrected a comment typo for the - getTopics proc in index.tcl [Bug #748700]. + * tools/man2help.tcl: Added duplicate help section checking + * tools/index.tcl: and corrected a comment typo for the + getTopics proc in index.tcl [Bug #748700]. 2003-06-02 Vince Darley @@ -238,14 +238,14 @@ 2003-05-23 Don Porter - * generic/tclObj.c (tclCmdNameType): Converted internal rep - management of the cmdName Tcl_ObjType the opposite way, to always - use the twoPtrValue instead of always using the otherValuePtr. - Previous fix on 2003-05-12 broke several extensions that wanted - to poke around with the twoPtrValue.ptr2 value of a cmdName - Tcl_Obj, like TclBlend and e4graph. [Bug 726018] - Thanks to George Petasis for the bug report and Jacob Levy for - testing assistance. + * generic/tclObj.c (tclCmdNameType): Converted internal rep + management of the cmdName Tcl_ObjType the opposite way, to always + use the twoPtrValue instead of always using the otherValuePtr. + Previous fix on 2003-05-12 broke several extensions that wanted + to poke around with the twoPtrValue.ptr2 value of a cmdName + Tcl_Obj, like TclBlend and e4graph. [Bug 726018] + Thanks to George Petasis for the bug report and Jacob Levy for + testing assistance. 2003-05-23 Mo DeJong diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index 50dfb02..150e384 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -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: tclPreserve.c,v 1.3 1999/04/16 00:46:52 stanton Exp $ + * RCS: @(#) $Id: tclPreserve.c,v 1.4 2003/07/16 21:24:12 hobbs Exp $ */ #include "tclInt.h" @@ -233,8 +233,7 @@ Tcl_Release(clientData) refArray[i] = refArray[inUse]; } if (mustFree) { - if ((freeProc == TCL_DYNAMIC) || - (freeProc == (Tcl_FreeProc *) free)) { + if (freeProc == TCL_DYNAMIC) { ckfree((char *) clientData); } else { Tcl_MutexUnlock(&preserveMutex); @@ -306,8 +305,7 @@ Tcl_EventuallyFree(clientData, freeProc) * No reference for this block. Free it now. */ - if ((freeProc == TCL_DYNAMIC) - || (freeProc == (Tcl_FreeProc *) free)) { + if (freeProc == TCL_DYNAMIC) { ckfree((char *) clientData); } else { (*freeProc)((char *)clientData); diff --git a/generic/tclResult.c b/generic/tclResult.c index 4eb3c69..22cf249 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclResult.c,v 1.6 2003/05/05 20:54:40 dgp Exp $ + * RCS: @(#) $Id: tclResult.c,v 1.7 2003/07/16 21:24:12 hobbs Exp $ */ #include "tclInt.h" @@ -198,8 +198,7 @@ Tcl_DiscardResult(statePtr) if (statePtr->result == statePtr->appendResult) { ckfree(statePtr->appendResult); } else if (statePtr->freeProc) { - if ((statePtr->freeProc == TCL_DYNAMIC) - || (statePtr->freeProc == (Tcl_FreeProc *) free)) { + if (statePtr->freeProc == TCL_DYNAMIC) { ckfree(statePtr->result); } else { (*statePtr->freeProc)(statePtr->result); @@ -265,8 +264,7 @@ Tcl_SetResult(interp, string, freeProc) */ if (oldFreeProc != 0) { - if ((oldFreeProc == TCL_DYNAMIC) - || (oldFreeProc == (Tcl_FreeProc *) free)) { + if (oldFreeProc == TCL_DYNAMIC) { ckfree(oldResult); } else { (*oldFreeProc)(oldResult); @@ -359,8 +357,7 @@ Tcl_SetObjResult(interp, objPtr) */ if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { + if (iPtr->freeProc == TCL_DYNAMIC) { ckfree(iPtr->result); } else { (*iPtr->freeProc)(iPtr->result); @@ -413,8 +410,7 @@ Tcl_GetObjResult(interp) TclInitStringRep(objResultPtr, iPtr->result, length); if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { + if (iPtr->freeProc == TCL_DYNAMIC) { ckfree(iPtr->result); } else { (*iPtr->freeProc)(iPtr->result); @@ -751,8 +747,7 @@ Tcl_FreeResult(interp) register Interp *iPtr = (Interp *) interp; if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { + if (iPtr->freeProc == TCL_DYNAMIC) { ckfree(iPtr->result); } else { (*iPtr->freeProc)(iPtr->result); @@ -791,8 +786,7 @@ Tcl_ResetResult(interp) ResetObjResult(iPtr); if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { + if (iPtr->freeProc == TCL_DYNAMIC) { ckfree(iPtr->result); } else { (*iPtr->freeProc)(iPtr->result); diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 4c929ef..4085e73 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtil.c,v 1.37 2003/04/16 23:33:44 dgp Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.38 2003/07/16 21:24:12 hobbs Exp $ */ #include "tclInt.h" @@ -1744,8 +1744,7 @@ Tcl_DStringGetResult(interp, dsPtr) dsPtr->length = strlen(iPtr->result); if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { + if (iPtr->freeProc == TCL_DYNAMIC) { dsPtr->string = iPtr->result; dsPtr->spaceAvl = dsPtr->length+1; } else { -- cgit v0.12