summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>2000-05-23 22:10:48 (GMT)
committerericm <ericm@noemail.net>2000-05-23 22:10:48 (GMT)
commit85fd0446b9426ead9ffe69d0fa323c47a70fa826 (patch)
treef33bb09809b6a1d88e4d4ac1ab8e54659e9a1a03 /generic/tclExecute.c
parent215c953dd40149819482b0bf3f5db5bb769fbb38 (diff)
downloadtcl-85fd0446b9426ead9ffe69d0fa323c47a70fa826.zip
tcl-85fd0446b9426ead9ffe69d0fa323c47a70fa826.tar.gz
tcl-85fd0446b9426ead9ffe69d0fa323c47a70fa826.tar.bz2
* generic/tclInt.h: Added function prototypes for
TclCompileStringCmd and TclCompileReturnCmd. * generic/tclCompile.h: Added definition of INST_STRLEN opcode and updated LAST_INST_OPCODE value. * generic/tclBasic.c: Added information about TclCompileStringCmd and TclCompileReturnCmd to BuiltInCmds table. * generic/tclExecute.c (TclExecuteByteCode): Added support for the INST_STRLEN opcode. * generic/tclCompCmds.c (TclCompileStringCmd): Basic implementation of byte-compiled [string] command. Not all subcommands are implemented; those that are not an out-line compiled. (TclCompileReturnCmd): Byte-compiled implementation of [return] command. Only "simple" returns are byte-compiled; in particular, if the -code, -errorinfo or -errorcode flags are used, the command is not byte-compiled. FossilOrigin-Name: 9a0e714517db92a68d4b01cb50afca32dc3985ba
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index f19a968..1169689 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.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: tclExecute.c,v 1.11 2000/05/09 00:00:34 hobbs Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.12 2000/05/23 22:10:51 ericm Exp $
*/
#include "tclInt.h"
@@ -1806,6 +1806,25 @@ TclExecuteByteCode(interp, codePtr)
}
ADJUST_PC(1);
+ case INST_STRLEN:
+ {
+ int length1;
+ valuePtr = POP_OBJECT();
+ if (valuePtr->typePtr == &tclByteArrayType) {
+ (void) Tcl_GetByteArrayFromObj(valuePtr, &length1);
+ } else {
+ length1 = Tcl_GetCharLength(valuePtr);
+ }
+ if (Tcl_IsShared(valuePtr)) {
+ PUSH_OBJECT(Tcl_NewIntObj(length1));
+ TclDecrRefCount(valuePtr);
+ } else {
+ Tcl_SetIntObj(valuePtr, length1);
+ ++stackTop;
+ }
+ }
+ ADJUST_PC(1);
+
case INST_EQ:
case INST_NEQ:
case INST_LT: