summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-01-21 02:25:25 (GMT)
committerhobbs <hobbs>2000-01-21 02:25:25 (GMT)
commitdf05056e3fba1a1d7b9cde6fc893514f18c6c5c5 (patch)
tree3f8bc62d1bca80a5df23cb59d2c23105866f2dae /generic/tclCmdIL.c
parentdf89ccaf7788364be35910a9f84ba16a854d1643 (diff)
downloadtcl-df05056e3fba1a1d7b9cde6fc893514f18c6c5c5.zip
tcl-df05056e3fba1a1d7b9cde6fc893514f18c6c5c5.tar.gz
tcl-df05056e3fba1a1d7b9cde6fc893514f18c6c5c5.tar.bz2
* generic/tclCmdIL.c (InfoBodyCmd): made [info body] return a
string if the body has been bytecompiled. * generic/tclBasic.c (Tcl_EvalObjEx): added pedantic check for originating proc body of bytecompiled code, #def'd out as the change for [info body] should make it unnecessary * tests/set.test: added test for complex array elem name compiling * generic/tclCompCmds.c (TclCompileSetCmd): Fixed parsing of array elements during compiling, and slightly optimised same [Bug: 3889]
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 4fe4f4a..4240f84 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.21 2000/01/13 20:33:10 ericm Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.22 2000/01/21 02:25:26 hobbs Exp $
*/
#include "tclInt.h"
@@ -563,9 +563,12 @@ InfoBodyCmd(dummy, interp, objc, objv)
}
/*
- * we need to check if the body from this procedure had been generated
- * from a precompiled body. If that is the case, then the bodyPtr's
- * string representation is bogus, since sources are not available.
+ * We should not return a bytecompiled body. If it is precompiled,
+ * then the bodyPtr's string representation is bogus, since sources
+ * are not available. If it was just a bytecompiled body, then it
+ * is likely to not be of any use to the caller, as it was compiled
+ * for a separate procedure context [Bug: 3412], and noone else can
+ * reasonably use it.
* In order to make sure that later manipulations of the object do not
* invalidate the internal representation, we make a copy of the string
* representation and return that one, instead.
@@ -574,11 +577,7 @@ InfoBodyCmd(dummy, interp, objc, objv)
bodyPtr = procPtr->bodyPtr;
resultPtr = bodyPtr;
if (bodyPtr->typePtr == &tclByteCodeType) {
- ByteCode *codePtr = (ByteCode *) bodyPtr->internalRep.otherValuePtr;
-
- if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) {
- resultPtr = Tcl_NewStringObj(bodyPtr->bytes, bodyPtr->length);
- }
+ resultPtr = Tcl_NewStringObj(bodyPtr->bytes, bodyPtr->length);
}
Tcl_SetObjResult(interp, resultPtr);