summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index d80e32f..66ed491 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.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: tclCmdAH.c,v 1.44 2004/04/06 22:25:48 dgp Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.45 2004/05/13 12:59:21 dkf Exp $
*/
#include "tclInt.h"
@@ -256,7 +256,18 @@ Tcl_CatchObjCmd(dummy, interp, objc, objv)
}
result = Tcl_EvalObjEx(interp, objv[1], 0);
-
+
+ /*
+ * We disable catch in interpreters where the limit has been exceeded.
+ */
+ if (Tcl_LimitExceeded(interp)) {
+ char msg[32 + TCL_INTEGER_SPACE];
+
+ sprintf(msg, "\n (\"catch\" body line %d)", interp->errorLine);
+ Tcl_AddErrorInfo(interp, msg);
+ return TCL_ERROR;
+ }
+
if (objc >= 3) {
if (NULL == Tcl_ObjSetVar2(interp, varNamePtr, NULL,
Tcl_GetObjResult(interp), 0)) {