From 4a0b54903a95f70e6582b4be1b83762c970dc81c Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 14 Jun 2007 15:56:05 +0000 Subject: * generic/tclCompile.c: SetByteCodeFromAny() can no longer return * generic/tclExecute.c: any code other than TCL_OK, so remove code * generic/tclProc.c: that formerly handled exceptional codes. --- ChangeLog | 6 ++++++ generic/tclCompile.c | 5 +++-- generic/tclExecute.c | 13 ++++--------- generic/tclProc.c | 53 ++++++++++++++++++---------------------------------- 4 files changed, 31 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6b7158..2d93ca0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-14 Don Porter + + * generic/tclCompile.c: SetByteCodeFromAny() can no longer return + * generic/tclExecute.c: any code other than TCL_OK, so remove code + * generic/tclProc.c: that formerly handled exceptional codes. + 2007-06-13 Miguel Sofer * generic/tclExecute.c (TclCompEvalObj): missed update to "there diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 1862cb2..f3aa2e4 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.118 2007/05/30 18:12:58 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.119 2007/06/14 15:56:05 dgp Exp $ */ #include "tclInt.h" @@ -585,7 +585,8 @@ SetByteCodeFromAny( * compiled. Must not be NULL. */ Tcl_Obj *objPtr) /* The object to make a ByteCode object. */ { - return TclSetByteCodeFromAny(interp, objPtr, NULL, (ClientData) NULL); + (void) TclSetByteCodeFromAny(interp, objPtr, NULL, (ClientData) NULL); + return TCL_OK; } /* diff --git a/generic/tclExecute.c b/generic/tclExecute.c index fd4474e..0071263 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.292 2007/06/14 02:43:14 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.293 2007/06/14 15:56:06 dgp Exp $ */ #include "tclInt.h" @@ -1186,15 +1186,10 @@ TclCompEvalObj( iPtr->invokeCmdFramePtr = invoker; iPtr->invokeWord = word; - result = tclByteCodeType.setFromAnyProc(interp, objPtr); + tclByteCodeType.setFromAnyProc(interp, objPtr); iPtr->invokeCmdFramePtr = NULL; - if (result == TCL_OK) { - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - goto runCompiledObj; - } else { - iPtr->numLevels--; - return result; - } + codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; + goto runCompiledObj; } /* diff --git a/generic/tclProc.c b/generic/tclProc.c index 6450edc..ff92c96 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclProc.c,v 1.117 2007/06/14 02:43:15 msofer Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.118 2007/06/14 15:56:07 dgp Exp $ */ #include "tclInt.h" @@ -1666,7 +1666,7 @@ ProcCompileProc( * (Proc *) value may be written. */ { Interp *iPtr = (Interp *) interp; - int i, result; + int i; Tcl_CallFrame *framePtr; Proc *saveProcPtr; ByteCode *codePtr = bodyPtr->internalRep.otherValuePtr; @@ -1800,45 +1800,28 @@ ProcCompileProc( } iPtr->compiledProcPtr = procPtr; - result = TclPushStackFrame(interp, &framePtr, + (void) TclPushStackFrame(interp, &framePtr, (Tcl_Namespace *) nsPtr, /* isProcCallFrame */ 0); - if (result == TCL_OK) { - /* - * TIP #280: We get the invoking context from the cmdFrame which - * was saved by 'Tcl_ProcObjCmd' (using linePBodyPtr). - */ - - Tcl_HashEntry *hePtr = Tcl_FindHashEntry(iPtr->linePBodyPtr, - (char *) procPtr); + /* + * TIP #280: We get the invoking context from the cmdFrame which + * was saved by 'Tcl_ProcObjCmd' (using linePBodyPtr). + */ - /* - * Constructed saved frame has body as word 0. See Tcl_ProcObjCmd. - */ + Tcl_HashEntry *hePtr = Tcl_FindHashEntry(iPtr->linePBodyPtr, + (char *) procPtr); - iPtr->invokeWord = 0; - iPtr->invokeCmdFramePtr = - (hePtr ? (CmdFrame *) Tcl_GetHashValue(hePtr) : NULL); - result = tclByteCodeType.setFromAnyProc(interp, bodyPtr); - iPtr->invokeCmdFramePtr = NULL; - TclPopStackFrame(interp); - } + /* + * Constructed saved frame has body as word 0. See Tcl_ProcObjCmd. + */ + iPtr->invokeWord = 0; + iPtr->invokeCmdFramePtr = + (hePtr ? (CmdFrame *) Tcl_GetHashValue(hePtr) : NULL); + (void) tclByteCodeType.setFromAnyProc(interp, bodyPtr); + iPtr->invokeCmdFramePtr = NULL; + TclPopStackFrame(interp); iPtr->compiledProcPtr = saveProcPtr; - - if (result != TCL_OK) { - if (result == TCL_ERROR) { - int length = strlen(procName); - int limit = 50; - int overflow = (length > limit); - - Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( - "\n (compiling %s \"%.*s%s\", line %d)", - description, (overflow ? limit : length), procName, - (overflow ? "..." : ""), interp->errorLine)); - } - return result; - } } else if (codePtr->nsEpoch != nsPtr->resolverEpoch) { /* * The resolver epoch has changed, but we only need to invalidate the -- cgit v0.12