summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclProc.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 2d16c7f..7c6e518 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.41 2002/08/05 03:24:41 dgp Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.42 2002/09/27 01:28:15 hobbs Exp $
*/
#include "tclInt.h"
@@ -150,8 +150,9 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
/*
- * Optimize for noop procs: if the argument list is just "args"
- * and the body is empty, define a compileProc.
+ * Optimize for noop procs: if the body is not precompiled, the argument
+ * list is just "args" and the body is empty, define a compileProc to
+ * compile a noop.
*
* Notes:
* - cannot be done for any argument list without having different
@@ -164,9 +165,17 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
* compilation of all procs whose argument list is just _args_
*/
+ if (objv[3]->typePtr == &tclByteCodeType) {
+ ByteCode *body = objv[3]->internalRep.otherValuePtr;
+
+ if (body->flags & TCL_BYTECODE_PRECOMPILED) {
+ goto done;
+ }
+ }
+
procArgs = Tcl_GetString(objv[2]);
- while(*procArgs == ' ') {
+ while (*procArgs == ' ') {
procArgs++;
}
@@ -184,7 +193,7 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
*/
procBody = Tcl_GetString(objv[3]);
- while(*procBody != '\0') {
+ while (*procBody != '\0') {
if (!isspace(UCHAR(*procBody))) {
goto done;
}