summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-07-09 14:26:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-07-09 14:26:56 (GMT)
commit464153fecd8fc19c3fffea23647beda104f50df0 (patch)
tree5bed41dbbfe5d7f5d7eee0ced8ea1b40d06dd0b4
parent139a16f60059a11a934ac0a1865c2fd4b530f4d4 (diff)
downloadtcl-464153fecd8fc19c3fffea23647beda104f50df0.zip
tcl-464153fecd8fc19c3fffea23647beda104f50df0.tar.gz
tcl-464153fecd8fc19c3fffea23647beda104f50df0.tar.bz2
Revise INST_INVOKE_REPLACE to call EvalObjv with TCL_EVAL_INVOKE and
no longer call EvalObjEx which does not support it reliably. Also convert to conventional list operations.
-rw-r--r--generic/tclExecute.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 8ddefda..52865e6 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -3153,20 +3153,7 @@ TEBCresume(
fflush(stdout);
}
#endif /*TCL_COMPILE_DEBUG*/
- {
- 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 - opnd + 1;
- copyObjv[0] = objPtr;
- memcpy(copyObjv+1, objv+opnd, sizeof(Tcl_Obj *) * (objc - opnd));
- for (i=1 ; i<objc-opnd+1 ; i++) {
- Tcl_IncrRefCount(copyObjv[i]);
- }
- objPtr = copyPtr;
- }
bcFramePtr->data.tebc.pc = (char *) pc;
iPtr->cmdFramePtr = bcFramePtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
@@ -3174,13 +3161,25 @@ TEBCresume(
}
TclInitRewriteEnsemble(interp, opnd, 1, objv);
+
+ {
+ Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL);
+
+ Tcl_ListObjAppendElement(NULL, copyPtr, objPtr);
+ Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0,
+ objc - opnd, objv + opnd);
+ objPtr = copyPtr;
+ }
+
DECACHE_STACK_INFO();
pc += 6;
TEBC_YIELD();
TclMarkTailcall(interp);
- TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL);
- return TclNREvalObjEx(interp, objPtr, TCL_EVAL_INVOKE, NULL, INT_MIN);
+ TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL);
+ Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv);
+ TclNRAddCallback(interp, TclNRReleaseValues, objPtr, NULL, NULL, NULL);
+ return TclNREvalObjv(interp, objc, objv, TCL_EVAL_INVOKE, NULL);
/*
* -----------------------------------------------------------------