diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-22 09:07:45 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-22 09:07:45 (GMT) |
| commit | 7716fd3e46e9f24eaa39c9fcf309c44aa0903bfb (patch) | |
| tree | c400df162e6d42778aee67fd8f71e5fcb0d383d2 /generic/tclBasic.c | |
| parent | 128e4211ae5e41a3a0cbe8f651ee211618dd9a38 (diff) | |
| download | tcl-7716fd3e46e9f24eaa39c9fcf309c44aa0903bfb.zip tcl-7716fd3e46e9f24eaa39c9fcf309c44aa0903bfb.tar.gz tcl-7716fd3e46e9f24eaa39c9fcf309c44aa0903bfb.tar.bz2 | |
[a90d9331bc]: must not crash when yieldto called in vanishing namespace
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 18 |
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. */ |
