From 6b698fdbdeb2c71d4e27829e834036824d3cd5bd Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 22 Oct 2004 13:48:40 +0000 Subject: Standardize way of calling object freeIntRepProcs... --- ChangeLog | 6 ++++++ generic/tclExecute.c | 6 +++--- generic/tclProc.c | 30 +++++++++++++++--------------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index d46d502..87ebc19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-22 Donal K. Fellows + + * generic/tclExecute.c (TclCompEvalObj, Tcl_ExprObj): + * generic/tclProc.c (TclProcCompileProc): Always call object + freeIntRepProc's in the same way. + 2004-10-22 Miguel Sofer * generic/tclVar.c: fixed bug in commit of 2004-07-23, which was diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 4268a3e..7aa187f 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.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: tclExecute.c,v 1.158 2004/10/18 21:15:38 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.159 2004/10/22 13:48:56 dkf Exp $ */ #ifdef STDC_HEADERS @@ -758,7 +758,7 @@ Tcl_ExprObj(interp, objPtr, resultPtrPtr) } codePtr->compileEpoch = iPtr->compileEpoch; } else { - (*tclByteCodeType.freeIntRepProc)(objPtr); + objPtr->typePtr->freeIntRepProc(objPtr); objPtr->typePtr = (Tcl_ObjType *) NULL; } } @@ -971,7 +971,7 @@ TclCompEvalObj(interp, objPtr) /* * This byteCode is invalid: free it and recompile */ - tclByteCodeType.freeIntRepProc(objPtr); + objPtr->typePtr->freeIntRepProc(objPtr); goto recompileObj; } } diff --git a/generic/tclProc.c b/generic/tclProc.c index 9ce8706..d35ba32 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.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: tclProc.c,v 1.62 2004/10/18 21:15:42 dgp Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.63 2004/10/22 13:48:58 dkf Exp $ */ #include "tclInt.h" @@ -1182,20 +1182,20 @@ TclProcCompileProc(interp, procPtr, bodyPtr, nsPtr, description, procName) if (bodyPtr->typePtr == &tclByteCodeType) { if (((Interp *) *codePtr->interpHandle != iPtr) - || (codePtr->compileEpoch != iPtr->compileEpoch) - || (codePtr->nsPtr != nsPtr)) { - if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { - if ((Interp *) *codePtr->interpHandle != iPtr) { - Tcl_AppendResult(interp, - "a precompiled script jumped interps", NULL); - return TCL_ERROR; - } - codePtr->compileEpoch = iPtr->compileEpoch; - codePtr->nsPtr = nsPtr; - } else { - (*tclByteCodeType.freeIntRepProc)(bodyPtr); - bodyPtr->typePtr = (Tcl_ObjType *) NULL; - } + || (codePtr->compileEpoch != iPtr->compileEpoch) + || (codePtr->nsPtr != nsPtr)) { + if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { + if ((Interp *) *codePtr->interpHandle != iPtr) { + Tcl_AppendResult(interp, + "a precompiled script jumped interps", NULL); + return TCL_ERROR; + } + codePtr->compileEpoch = iPtr->compileEpoch; + codePtr->nsPtr = nsPtr; + } else { + bodyPtr->typePtr->freeIntRepProc(bodyPtr); + bodyPtr->typePtr = (Tcl_ObjType *) NULL; + } } } if (bodyPtr->typePtr != &tclByteCodeType) { -- cgit v0.12