summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-01-22 09:07:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-01-22 09:07:45 (GMT)
commit78a75740ae5c82cc161e49e5e28a306fa9f2a580 (patch)
treec400df162e6d42778aee67fd8f71e5fcb0d383d2 /generic/tclBasic.c
parent61bfac2613d3cc063099ad9e6de3110491b6f5df (diff)
downloadtcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.zip
tcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.tar.gz
tcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.tar.bz2
[a90d9331bc]: must not crash when yieldto called in vanishing namespace
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e355229..cb9428c 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -8431,11 +8431,13 @@ TclNRYieldToObjCmd(
return TCL_ERROR;
}
- /*
- * Add the tailcall in the caller env, then just yield.
- *
- * This is essentially code from TclNRTailcallObjCmd
- */
+ if (((Namespace *) TclGetCurrentNamespace(interp))->flags & NS_DYING) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "yieldto called in deleted namespace", -1));
+ Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED",
+ NULL);
+ return TCL_ERROR;
+ }
/*
* Add the tailcall in the caller env, then just yield.
@@ -8444,15 +8446,9 @@ TclNRYieldToObjCmd(
*/
listPtr = Tcl_NewListObj(objc, objv);
-
nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1);
- if ((TCL_OK != TclGetNamespaceFromObj(interp, nsObjPtr, &ns1Ptr))
- || (nsPtr != ns1Ptr)) {
- Tcl_Panic("yieldto failed to find the proper namespace");
- }
TclListObjSetElement(interp, listPtr, 0, nsObjPtr);
-
/*
* Add the callback in the caller's env, then instruct TEBC to yield.
*/