From de9eaa2261bbda12a5ba8a76ec1a29d28a8b651b Mon Sep 17 00:00:00 2001 From: mig Date: Sun, 13 Mar 2011 06:59:04 +0000 Subject: * generic/tclExecute.c: remove TEBCreturn() --- ChangeLog | 4 ++++ generic/tclExecute.c | 37 ++++++++++--------------------------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37bd48b..10f1f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-03-13 Miguel Sofer + + * generic/tclExecute.c: remove TEBCreturn() + 2011-03-12 Donal K. Fellows * generic/tcl.h (ckalloc,ckfree,ckrealloc): Moved casts into these 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 -- cgit v0.12