summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclProc.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d9e0f69..704637b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tclProc.c (InitLocalCache): reference firstLocalPtr via
+ procPtr. codePtr->procPtr == NULL exposed by tbcload.
+
2007-08-08 Don Porter <dgp@users.sourceforge.net>
* generic/tclExecute.c: Corrected failure to compile/link
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;