diff options
author | dgp <dgp@users.sourceforge.net> | 2007-06-20 18:46:05 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-06-20 18:46:05 (GMT) |
commit | 990150fd25c8206ca25d424fafbdfd2b81199d1f (patch) | |
tree | 3d231361d50bc42a020d3f65eefb68a5951da2ae /generic/tclCompCmds.c | |
parent | 03e71e94a6bfa74deaf5a629ba1b72353f17bfc7 (diff) | |
download | tcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.zip tcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.tar.gz tcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.tar.bz2 |
* generic/tclInt.decls: Revised the interfaces of the routines
* generic/tclExecute.c: TclStackAlloc and TclStackFree to make them
easier for callers to use (or more precisely, harder to misuse).
TclStackFree now takes a (void *) argument which is the pointer
intended to be freed. TclStackFree will panic if that's not actually
the memory the call will free. TSA/TSF also now tolerate receiving
(interp == NULL), in which case they simply fall back to be calls to
Tcl_Alloc/Tcl_Free.
* generic/tclIntDecls.h: make genstubs
* generic/tclBasic.c: Updated callers
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCompCmds.c:
* generic/tclCompExpr.c:
* generic/tclCompile.c:
* generic/tclFCmd.c:
* generic/tclFileName.c:
* generic/tclIOCmd.c:
* generic/tclIndexObj.c:
* generic/tclInterp.c:
* generic/tclNamesp.c:
* generic/tclProc.c:
* generic/tclTrace.c:
* unix/tclUnixPipe.c:
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r-- | generic/tclCompCmds.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 952f4bd..3801886 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.110 2007/06/15 22:58:48 msofer Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.111 2007/06/20 18:46:11 dgp Exp $ */ #include "tclInt.h" @@ -948,14 +948,14 @@ TclCompileDictCmd( tokenPtr = TokenAfter(tokenPtr); if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { ckfree((char *) duiPtr); - TclStackFree(interp); /* keyTokenPtrs */ + TclStackFree(interp, keyTokenPtrs); return TCL_ERROR; } name = tokenPtr[1].start; nameChars = tokenPtr[1].size; if (!TclIsLocalScalar(name, nameChars)) { ckfree((char *) duiPtr); - TclStackFree(interp); /* keyTokenPtrs */ + TclStackFree(interp, keyTokenPtrs); return TCL_ERROR; } duiPtr->varIndices[i] = TclFindCompiledLocal(name, nameChars, 1, @@ -964,7 +964,7 @@ TclCompileDictCmd( } if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { ckfree((char *) duiPtr); - TclStackFree(interp); /* keyTokenPtrs */ + TclStackFree(interp, keyTokenPtrs); return TCL_ERROR; } bodyTokenPtr = tokenPtr; @@ -1015,7 +1015,7 @@ TclCompileDictCmd( TclEmitInt4( infoIndex, envPtr); TclEmitOpcode( INST_RETURN_STK, envPtr); - TclStackFree(interp); /* keyTokenPtrs */ + TclStackFree(interp, keyTokenPtrs); return TCL_OK; } else if (size==6 && strncmp(cmd, "append", 6) == 0) { Tcl_Token *varTokenPtr; @@ -1665,8 +1665,8 @@ TclCompileForeachCmd( ckfree((char *) varvList[loopIndex]); } } - TclStackFree(interp); /* varvList */ - TclStackFree(interp); /* varcList */ + TclStackFree(interp, varvList); + TclStackFree(interp, varcList); return code; } @@ -2995,7 +2995,7 @@ TclCompileRegexpCmd( if ((strpbrk(str + start, "*+?{}()[].\\|^$") != NULL) || (Tcl_RegExpCompile(NULL, str) == NULL)) { - TclStackFree(interp); /* str */ + TclStackFree(interp, str); return TCL_ERROR; } @@ -3021,9 +3021,9 @@ TclCompileRegexpCmd( } newStr[len] = '\0'; PushLiteral(envPtr, newStr, len); - TclStackFree(interp); /* newStr */ + TclStackFree(interp, newStr); } - TclStackFree(interp); /* str */ + TclStackFree(interp, str); /* * Push the string arg. @@ -3128,7 +3128,7 @@ TclCompileReturnCmd( while (--objc >= 0) { TclDecrRefCount(objv[objc]); } - TclStackFree(interp); /* objv */ + TclStackFree(interp, objv); if (TCL_ERROR == status) { /* * Something was bogus in the return options. Clear the error message, @@ -4696,7 +4696,7 @@ PushVarName( ++varTokenPtr[removedParen].size; } if (allocedTokens) { - TclStackFree(interp); /* elemTokenPtr */ + TclStackFree(interp, elemTokenPtr); } *localIndexPtr = localIndex; *simpleVarNamePtr = simpleVarName; |