summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-13 12:59:04 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-13 12:59:04 (GMT)
commit81bf158695e5ecff209636d52392ca7f21675f23 (patch)
tree6e35a78f3d83e2cb85b57d1401aaf89989c6ff3d /generic/tclCmdAH.c
parent2aee97bf214b4578d446e48cc0a67321d06cf62b (diff)
downloadtcl-81bf158695e5ecff209636d52392ca7f21675f23.zip
tcl-81bf158695e5ecff209636d52392ca7f21675f23.tar.gz
tcl-81bf158695e5ecff209636d52392ca7f21675f23.tar.bz2
TIP#143 implementation; still needs docs and more tests...
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)) {