From 38941ce68c0dc6530844e8d58bd9ba4f4582a92e Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Wed, 3 Jul 2002 17:33:33 +0000 Subject: * generic/tclCompCmds.c (TclCompileCatchCmd): return TCL_OUT_LINE_COMPILE instead of TCL_ERROR: let the failure happen at runtime so that it can be caught [Bug 577015]. --- ChangeLog | 6 ++++++ generic/tclCompCmds.c | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index de077fc..1ce0013 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-07-03 Miguel Sofer + + * generic/tclCompCmds.c (TclCompileCatchCmd): return + TCL_OUT_LINE_COMPILE instead of TCL_ERROR: let the failure happen + at runtime so that it can be caught [Bug 577015]. + 2002-07-02 Joe English * doc/tcltest.n: Markup fixes, spellcheck. diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 3b04946..43d2146 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.30 2002/06/11 15:42:20 msofer Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.31 2002/07/03 17:33:39 msofer Exp $ */ #include "tclInt.h" @@ -244,7 +244,6 @@ TclCompileCatchCmd(interp, parsePtr, envPtr) char *name; int localIndex, nameChars, range, startOffset, jumpDist; int code; - char buffer[32 + TCL_INTEGER_SPACE]; int savedStackDepth = envPtr->currStackDepth; if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { @@ -321,11 +320,7 @@ TclCompileCatchCmd(interp, parsePtr, envPtr) envPtr->exceptArrayPtr[range].codeOffset = startOffset; if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"catch\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } + code = TCL_OUT_LINE_COMPILE; goto done; } envPtr->exceptArrayPtr[range].numCodeBytes = -- cgit v0.12