summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-09-01 00:51:30 (GMT)
committerhobbs <hobbs>2001-09-01 00:51:30 (GMT)
commite3a668d0116f88c8a2cb5a58378d1ff551f82255 (patch)
treeb023a6cb73d9766f25ad188e04c1669744183279 /generic/tclExecute.c
parent64560d95933f485db584e3a2bdedb5c7d8362420 (diff)
downloadtcl-e3a668d0116f88c8a2cb5a58378d1ff551f82255.zip
tcl-e3a668d0116f88c8a2cb5a58378d1ff551f82255.tar.gz
tcl-e3a668d0116f88c8a2cb5a58378d1ff551f82255.tar.bz2
* generic/tcl.h: added TclCompileListCmd header
* generic/tclBasic.c: added TclCompileListCmd compile proc * generic/tclCompCmds.c (TclCompileListCmd): function to compile the 'list' command at parse time. * generic/tclExecute.c (TclExecuteByteCode): definition of INST_LIST bytecode.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 97bb5ee..549e908 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.27 2001/08/30 12:04:13 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.28 2001/09/01 00:51:31 hobbs Exp $
*/
#include "tclInt.h"
@@ -1388,7 +1388,7 @@ TclExecuteByteCode(interp, codePtr)
case INST_APPEND_ARRAY1:
opnd = TclGetUInt1AtPtr(pc+1);
pcAdjustment = 2;
-
+
doAppendArray:
valuePtr = POP_OBJECT();
elemPtr = POP_OBJECT();
@@ -1415,6 +1415,24 @@ TclExecuteByteCode(interp, codePtr)
/*
* END APPEND INSTRUCTIONS
*/
+
+ case INST_LIST:
+ /*
+ * Pop the opnd (objc) top stack elements into a new list obj
+ * and then decrement their ref counts.
+ */
+
+ opnd = TclGetUInt4AtPtr(pc+1);
+ valuePtr = Tcl_NewListObj(opnd, &(stackPtr[stackTop - (opnd-1)]));
+
+ for (i = 0; i < opnd; i++) {
+ TclDecrRefCount(stackPtr[stackTop--]);
+ }
+
+ PUSH_OBJECT(valuePtr);
+ TRACE_WITH_OBJ(("%u => " opnd), valuePtr);
+ ADJUST_PC(5);
+
/*
* START LAPPEND INSTRUCTIONS
*/