diff options
author | hobbs <hobbs> | 2007-08-08 22:57:13 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-08-08 22:57:13 (GMT) |
commit | a4eeb94ff4ff15234e1513f1535c79690f9ea2bc (patch) | |
tree | 6479150eea89153868f90153c6bde104899ae2f7 /generic/tclProc.c | |
parent | 365ad526523e348e7763aca71cc96aaa6d582b82 (diff) | |
download | tcl-a4eeb94ff4ff15234e1513f1535c79690f9ea2bc.zip tcl-a4eeb94ff4ff15234e1513f1535c79690f9ea2bc.tar.gz tcl-a4eeb94ff4ff15234e1513f1535c79690f9ea2bc.tar.bz2 |
* generic/tclProc.c (InitLocalCache): reference firstLocalPtr via
procPtr. codePtr->procPtr == NULL exposed by tbcload.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r-- | generic/tclProc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index 0148449..026a836 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.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: tclProc.c,v 1.129 2007/08/08 18:39:20 msofer Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.130 2007/08/08 22:57:14 hobbs Exp $ */ #include "tclInt.h" @@ -1171,7 +1171,6 @@ InitResolvedLocals( CompiledLocal *firstLocalPtr, *localPtr; int varNum; Tcl_ResolvedVarInfo *resVarInfo; - /* * Find the localPtr corresponding to varPtr @@ -1296,28 +1295,28 @@ InitLocalCache(Proc *procPtr) { Interp *iPtr = procPtr->iPtr; ByteCode *codePtr = procPtr->bodyPtr->internalRep.otherValuePtr; - CompiledLocal *localPtr = codePtr->procPtr->firstLocalPtr; int localCt = procPtr->numCompiledLocals; int numArgs = procPtr->numArgs, i = 0; Tcl_Obj **namePtr; Var *varPtr; LocalCache *localCachePtr; + CompiledLocal *localPtr; int new; - + /* * Cache the names and initial values of local variables; store the * cache in both the framePtr for this execution and in the codePtr * for future calls. */ - + localCachePtr = (LocalCache *) ckalloc(sizeof(LocalCache) + (localCt-1)*sizeof(Tcl_Obj *) + numArgs*sizeof(Var)); - + namePtr = &localCachePtr->varName0; varPtr = (Var *) (namePtr + localCt); - localPtr = codePtr->procPtr->firstLocalPtr; + localPtr = procPtr->firstLocalPtr; while (localPtr) { if (TclIsVarTemporary(localPtr)) { *namePtr = NULL; @@ -1327,7 +1326,7 @@ InitLocalCache(Proc *procPtr) &new, /* nsPtr */ NULL, 0, NULL); Tcl_IncrRefCount(*namePtr); } - + if (i < numArgs) { varPtr->flags = (localPtr->flags & VAR_IS_ARGS); varPtr->value.objPtr = localPtr->defValuePtr; |