summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 3fab3cc..b0da17d 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2974,6 +2974,7 @@ TEBCresume(
case INST_INVOKE_REPLACE:
objc = TclGetUInt4AtPtr(pc+1);
+ opnd = TclGetUInt1AtPtr(pc+5);
objPtr = POP_OBJECT();
objv = &OBJ_AT_DEPTH(objc-1);
cleanup = objc;
@@ -2983,8 +2984,7 @@ TEBCresume(
if (traceInstructions) {
strncpy(cmdNameBuf, TclGetString(objv[0]), 20);
- TRACE(("%u => call (implementation %s) ",
- objc, O2S(objPtr)));
+ TRACE(("%u => call (implementation %s) ", objc, O2S(objPtr)));
} else {
fprintf(stdout,
"%d: (%u) invoking (using implementation %s) ",
@@ -2992,7 +2992,13 @@ TEBCresume(
O2S(objPtr));
}
for (i = 0; i < objc; i++) {
- TclPrintObject(stdout, objv[i], 15);
+ if (i < opnd) {
+ fprintf(stdout, "<");
+ TclPrintObject(stdout, objv[i], 15);
+ fprintf(stdout, ">");
+ } else {
+ TclPrintObject(stdout, objv[i], 15);
+ }
fprintf(stdout, " ");
}
fprintf(stdout, "\n");
@@ -3000,15 +3006,15 @@ TEBCresume(
}
#endif /*TCL_COMPILE_DEBUG*/
{
- Tcl_Obj *copyPtr = Tcl_NewListObj(objc - 1, NULL);
+ Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL);
register List *listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1;
Tcl_Obj **copyObjv = &listRepPtr->elements;
int i;
- listRepPtr->elemCount = objc - 1;
+ listRepPtr->elemCount = objc - opnd + 1;
copyObjv[0] = objPtr;
- memcpy(copyObjv+1, objv+2, sizeof(Tcl_Obj *) * (objc - 2));
- for (i=1 ; i<objc-1 ; i++) {
+ memcpy(copyObjv+1, objv+opnd, sizeof(Tcl_Obj *) * (objc - opnd));
+ for (i=1 ; i<objc-opnd+1 ; i++) {
Tcl_IncrRefCount(copyObjv[i]);
}
objPtr = copyPtr;
@@ -3020,10 +3026,10 @@ TEBCresume(
codePtr, bcFramePtr, pc - codePtr->codeStart);
}
iPtr->ensembleRewrite.sourceObjs = objv;
- iPtr->ensembleRewrite.numRemovedObjs = 2;
+ iPtr->ensembleRewrite.numRemovedObjs = opnd;
iPtr->ensembleRewrite.numInsertedObjs = 1;
DECACHE_STACK_INFO();
- pc += 5;
+ pc += 6;
TEBC_YIELD();
TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL);
iPtr->evalFlags |= TCL_EVAL_REDIRECT;