Tcl Source Code

Artifact [a115420ee9]
Login

Artifact a115420ee92692038f8c4676645079f9963d53a2:

Attachment "procns.diff" to ticket [944803ffff] added by coldstore 2004-08-23 06:41:16.
Index: tclCompile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompile.c,v
retrieving revision 1.66
diff -u -r1.66 tclCompile.c
--- tclCompile.c	16 May 2004 17:25:48 -0000	1.66
+++ tclCompile.c	22 Aug 2004 23:32:26 -0000
@@ -930,7 +930,7 @@
     isFirstCmd = 1;
 
     if (envPtr->procPtr != NULL) {
-	cmdNsPtr = envPtr->procPtr->cmdPtr->nsPtr;
+	cmdNsPtr = envPtr->procPtr->proc2ns;
     } else {
 	cmdNsPtr = NULL; /* use current NS */
     }
Index: tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.161
diff -u -r1.161 tclInt.h
--- tclInt.h	20 May 2004 13:04:11 -0000	1.161
+++ tclInt.h	22 Aug 2004 23:32:28 -0000
@@ -640,7 +640,7 @@
 				   * to the procedure that is currently
 				   * active. This structure can be freed
 				   * when refCount becomes zero. */
-    struct Command *cmdPtr;	  /* Points to the Command structure for
+    struct Namespace *proc2ns;		/* points to the NS for this proc's scope for
 				   * this procedure. This is used to get
 				   * the namespace in which to execute
 				   * the procedure. */
Index: tclProc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclProc.c,v
retrieving revision 1.52
diff -u -r1.52 tclProc.c
--- tclProc.c	4 May 2004 03:20:22 -0000	1.52
+++ tclProc.c	22 Aug 2004 23:32:29 -0000
@@ -146,7 +146,7 @@
      * namespace if the proc was renamed into a different namespace.
      */
     
-    procPtr->cmdPtr = (Command *) cmd;
+    procPtr->proc2ns = ((Command *) cmd)->nsPtr;
 
 
     /*
@@ -892,7 +892,7 @@
     Tcl_Obj *CONST objv[];	 /* Argument value objects. */
 {
     register Proc *procPtr = (Proc *) clientData;
-    Namespace *nsPtr = procPtr->cmdPtr->nsPtr;
+    Namespace *nsPtr = procPtr->proc2ns;
     CallFrame frame;
     register CallFrame *framePtr = &frame;
     register Var *varPtr;