diff options
author | dgp <dgp@users.sourceforge.net> | 2016-07-01 12:58:37 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-07-01 12:58:37 (GMT) |
commit | 433b92a00d44b96abae641511c035fdb9e21f75d (patch) | |
tree | 203956ace21c18239a2aaa98b12d5c1a905e8f4e /generic | |
parent | d2629fb2726fa18af638288c9c9aa89369b9fade (diff) | |
parent | e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d (diff) | |
download | tcl-433b92a00d44b96abae641511c035fdb9e21f75d.zip tcl-433b92a00d44b96abae641511c035fdb9e21f75d.tar.gz tcl-433b92a00d44b96abae641511c035fdb9e21f75d.tar.bz2 |
merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclProc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index b663caf..ae9e7cd 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1087,12 +1087,10 @@ ProcWrongNumArgs( if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) { desiredObjs[0] = Tcl_NewStringObj("lambdaExpr", -1); } else { - ((Interp *) interp)->ensembleRewrite.numInsertedObjs -= skip - 1; - #ifdef AVOID_HACKS_FOR_ITCL desiredObjs[0] = framePtr->objv[skip-1]; #else - desiredObjs[0] = Tcl_NewListObj(skip, framePtr->objv); + desiredObjs[0] = Tcl_NewListObj(1, framePtr->objv + skip - 1); #endif /* AVOID_HACKS_FOR_ITCL */ } Tcl_IncrRefCount(desiredObjs[0]); @@ -1527,6 +1525,10 @@ InitArgsAndLocals( */ incorrectArgs: + if ((skip != 1) && + TclInitRewriteEnsemble(interp, skip-1, 0, framePtr->objv)) { + TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); + } memset(varPtr, 0, ((framePtr->compiledLocals + localCt)-varPtr) * sizeof(Var)); return ProcWrongNumArgs(interp, skip); @@ -2716,10 +2718,6 @@ TclNRApplyObjCmd( extraPtr->efi.fields[0].clientData = lambdaPtr; extraPtr->cmd.clientData = &extraPtr->efi; - if (TclInitRewriteEnsemble(interp, 1, 0, objv)) { - TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); - } - result = TclPushProcCallFrame(procPtr, interp, objc, objv, 1); if (result == TCL_OK) { TclNRAddCallback(interp, ApplyNR2, extraPtr, NULL, NULL, NULL); |