diff options
author | dgp <dgp@users.sourceforge.net> | 2016-07-01 12:21:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-07-01 12:21:15 (GMT) |
commit | e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d (patch) | |
tree | 0f7945093065b3baef04bea61e4cea31a362d286 /generic/tclProc.c | |
parent | edc450c53752cf92b00a45883fee2d66a2bde27c (diff) | |
download | tcl-e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d.zip tcl-e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d.tar.gz tcl-e0b5fcdb1f044670d0a010d38b4b88fedf16ab0d.tar.bz2 |
Use the utility routines to eliminate the last bit of intrusion into the
ensembleRewrite area.
Diffstat (limited to 'generic/tclProc.c')
-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); |