summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index a1f4479..a93de79 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -715,7 +715,6 @@ static Tcl_NRPostProc CopyCallback;
static Tcl_NRPostProc ExprObjCallback;
static Tcl_NRPostProc TEBCresume;
-static Tcl_NRPostProc TEBCreturn;
/*
* The structure below defines a bytecode Tcl object type to hold the
@@ -1993,13 +1992,9 @@ TclNRExecuteByteCode(
#endif
/*
- * Push the callbacks for
- * - exception handling and cleanup
- * - bytecode execution
+ * Push the callback for bytecode execution
*/
- TclNRAddCallback(interp, TEBCreturn, TD, NULL,
- NULL, NULL);
TclNRAddCallback(interp, TEBCresume, TD,
/*resume*/ INT2PTR(0), NULL, NULL);
@@ -2007,26 +2002,6 @@ TclNRExecuteByteCode(
}
static int
-TEBCreturn(
- ClientData data[],
- Tcl_Interp *interp,
- int result)
-{
- TEBCdata *TD = data[0];
- ByteCode *codePtr = TD->codePtr;
-
- if (--codePtr->refCount <= 0) {
- TclCleanupByteCode(codePtr);
- }
- while (TD->expanded) {
- TD = TD->expanded;
- }
- TclStackFree(interp, TD); /* free my stack */
-
- return result;
-}
-
-static int
TEBCresume(
ClientData data[],
Tcl_Interp *interp,
@@ -2132,7 +2107,6 @@ TEBCresume(
result = TCL_ERROR;
}
NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
- NRE_ASSERT(TOP_CB(interp)->procPtr == TEBCreturn);
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);
@@ -6431,8 +6405,17 @@ TEBCresume(
}
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
+ if (--codePtr->refCount <= 0) {
+ TclCleanupByteCode(codePtr);
+ }
+ while (TD->expanded) {
+ TD = TD->expanded;
+ }
+ TclStackFree(interp, TD); /* free my stack */
+
return result;
}
+
#undef codePtr
#undef iPtr
#undef bcFramePtr