summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-08-23 01:48:24 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-08-23 01:48:24 (GMT)
commit0e7c2a3c941ea709e13087114f8467e4b19d0777 (patch)
tree78339a61d78b0f23cd459158bd0816a368730557
parent94a254e8f66296402989d1c1fae71f7bc0b88f4d (diff)
downloadtcl-0e7c2a3c941ea709e13087114f8467e4b19d0777.zip
tcl-0e7c2a3c941ea709e13087114f8467e4b19d0777.tar.gz
tcl-0e7c2a3c941ea709e13087114f8467e4b19d0777.tar.bz2
* generic/tclBasic.c: Set special errocodes: COROUTINE_BUSY,
COROUTINE_CANT_YIELD, COROUTINE_ILLEGAL_YIELD.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclExecute.c4
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 29ac32c..82fefe2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2008-08-22 Miguel Sofer <msofer@users.sf.net>
- * generic/tclBasic.c: Set a special COROUTINE_BUSY errorcode
+ * generic/tclBasic.c: Set special errocodes: COROUTINE_BUSY,
+ COROUTINE_CANT_YIELD, COROUTINE_ILLEGAL_YIELD.
2008-08-22 Don Porter <dgp@users.sourceforge.net>
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index d8ab1d0..30631a5 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.360 2008/08/23 01:42:54 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.361 2008/08/23 01:48:25 msofer Exp $
*/
#include "tclInt.h"
@@ -4302,9 +4302,11 @@ NRCallTEBC(
case TCL_NR_YIELD_TYPE:
if (iPtr->execEnvPtr->corPtr) {
Tcl_SetResult(interp, "cannot yield: C stack busy", TCL_STATIC);
+ Tcl_SetErrorCode(interp, "COROUTINE_CANT_YIELD", NULL);
} else {
Tcl_SetResult(interp, "yield can only be called in a coroutine",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "COROUTINE_ILLEGAL_YIELD", NULL);
}
return TCL_ERROR;
default:
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 0311da2..453be92 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,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.407 2008/08/20 15:02:32 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.408 2008/08/23 01:48:26 msofer Exp $
*/
#include "tclInt.h"
@@ -1946,6 +1946,7 @@ TclExecuteByteCode(
if (!corPtr) {
Tcl_SetResult(interp,
"yield can only be called in a coroutine", TCL_STATIC);
+ Tcl_SetErrorCode(interp, "COROUTINE_ILLEGAL_YIELD", NULL);
result = TCL_ERROR;
goto checkForCatch;
}
@@ -1955,6 +1956,7 @@ TclExecuteByteCode(
if (corPtr->stackLevel != &initLevel) {
Tcl_SetResult(interp,
"cannot yield: C stack busy", TCL_STATIC);
+ Tcl_SetErrorCode(interp, "COROUTINE_CANT_YIELD", NULL);
result = TCL_ERROR;
goto checkForCatch;
}