summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclBasic.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 4a95340..ca49bec 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -133,7 +133,9 @@ static Tcl_NRPostProc NRCoroutineCallerCallback;
static Tcl_NRPostProc NRCoroutineExitCallback;
static int NRCommand(ClientData data[], Tcl_Interp *interp, int result);
+#if 0
static Tcl_NRPostProc NRRunObjProc;
+#endif
static Tcl_ObjCmdProc OldMathFuncProc;
static void OldMathFuncDeleteProc(ClientData clientData);
static void ProcessUnexpectedResult(Tcl_Interp *interp,
@@ -159,6 +161,8 @@ static Tcl_NRPostProc TEOV_NotFoundCallback;
static Tcl_NRPostProc TEOV_RestoreVarFrame;
static Tcl_NRPostProc TEOV_RunLeaveTraces;
+static Tcl_NRPostProc Dispatch;
+
static Tcl_ObjCmdProc NRCoroInjectObjCmd;
MODULE_SCOPE const TclStubs tclStubs;
@@ -4232,15 +4236,39 @@ TclNREvalObjv(
*cmdPtrPtr = cmdPtr;
cmdPtr->refCount++;
+ TclNRAddCallback(interp, Dispatch, cmdPtr, INT2PTR(objc), objv, NULL);
+ return TCL_OK;
+
/*
* Find the objProc to call: nreProc if available, objProc otherwise. Push
* a callback to do the actual running.
*/
if (cmdPtr->nreProc) {
+#if 0
TclNRAddCallback(interp, NRRunObjProc, cmdPtr,
INT2PTR(objc), (ClientData) objv, NULL);
return TCL_OK;
+#else
+ return cmdPtr->nreProc(cmdPtr->objClientData, interp, objc, objv);
+#endif
+ } else {
+ return cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv);
+ }
+}
+
+static int
+Dispatch(
+ ClientData data[],
+ Tcl_Interp *interp,
+ int result)
+{
+ Command *cmdPtr = data[0];
+ int objc = PTR2INT(data[1]);
+ Tcl_Obj **objv = data[2];
+
+ if (cmdPtr->nreProc) {
+ return cmdPtr->nreProc(cmdPtr->objClientData, interp, objc, objv);
} else {
return cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv);
}
@@ -4323,6 +4351,7 @@ NRCommand(
return result;
}
+#if 0
static int
NRRunObjProc(
ClientData data[],
@@ -4337,6 +4366,7 @@ NRRunObjProc(
return cmdPtr->nreProc(cmdPtr->objClientData, interp, objc, objv);
}
+#endif
/*