diff options
author | dgp <dgp@users.sourceforge.net> | 2007-09-09 16:51:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-09-09 16:51:15 (GMT) |
commit | 661d0c07c6af17979d24832f834aae99e2377dac (patch) | |
tree | e92e8e7a5af578b7fbfc1a01740d384a0548acfa /generic/tclExecute.c | |
parent | 348e41c66d05f58ef37fb1307b90d49a09b112db (diff) | |
download | tcl-661d0c07c6af17979d24832f834aae99e2377dac.zip tcl-661d0c07c6af17979d24832f834aae99e2377dac.tar.gz tcl-661d0c07c6af17979d24832f834aae99e2377dac.tar.bz2 |
* generic/tclCompCmds.c: Use the new INST_REVERSE instruction
* tests/mathop.test: to correct the compiled versions of math
operator commands. [Bug 1724437].
* generic/tclCompile.c: New bytecode instruction INST_REVERSE to
* generic/tclCompile.h: reverse the order of N items at the top of
* generic/tclExecute.c: stack.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 87b1024..e133c55 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,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.330 2007/09/08 22:36:59 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.331 2007/09/09 16:51:19 dgp Exp $ */ #include "tclInt.h" @@ -1883,6 +1883,22 @@ TclExecuteByteCode( NEXT_INST_F(5, 0, 1); } + case INST_REVERSE: { + int opnd; + Tcl_Obj **a, **b; + + opnd = TclGetUInt4AtPtr(pc+1); + a = tosPtr-(opnd-1); + b = tosPtr; + while (a<b) { + Tcl_Obj *temp = *a; + *a = *b; + *b = temp; + a++; b--; + } + NEXT_INST_F(5, 0, 0); + } + case INST_CONCAT1: { int opnd, length, appendLen = 0; char *bytes, *p; |