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 | 78a75740ae5c82cc161e49e5e28a306fa9f2a580 (patch) | |
tree | c400df162e6d42778aee67fd8f71e5fcb0d383d2 /generic/tclExecute.c | |
parent | 61bfac2613d3cc063099ad9e6de3110491b6f5df (diff) | |
download | tcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.zip tcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.tar.gz tcl-78a75740ae5c82cc161e49e5e28a306fa9f2a580.tar.bz2 |
[a90d9331bc]: must not crash when yieldto called in vanishing namespace
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 575f227..6749120 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2542,6 +2542,17 @@ TEBCresume( CACHE_STACK_INFO(); goto gotError; } + if (((Namespace *)TclGetCurrentNamespace(interp))->flags & NS_DYING) { + TRACE(("[%.30s] => ERROR: yield in deleted\n", + O2S(valuePtr))); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "yieldto called in deleted namespace", -1)); + DECACHE_STACK_INFO(); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED", + NULL); + CACHE_STACK_INFO(); + goto gotError; + } #ifdef TCL_COMPILE_DEBUG if (tclTraceExec >= 2) { |