diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-08-26 08:39:47 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-08-26 08:39:47 (GMT) |
commit | 3f4897852c302eb336547bdda59ab890dc43e823 (patch) | |
tree | 7b051d25ff4428add82ffa22a71da704fb1000a1 | |
parent | 2a48cc8339e254c85a4879e73946dc2b8e73593f (diff) | |
download | tcl-3f4897852c302eb336547bdda59ab890dc43e823.zip tcl-3f4897852c302eb336547bdda59ab890dc43e823.tar.gz tcl-3f4897852c302eb336547bdda59ab890dc43e823.tar.bz2 |
Fix crashes when running Snit's test suite caused by traces forcing the interp
result object to become shared.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclNamesp.c | 7 |
2 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2005-08-26 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tclNamesp.c (NamespaceEnsembleCmd): Reset the result after + creating an ensemble to clear any result object sharing (potentially + caused by delete traces) so that we can safely return the name of the + ensemble. Previously, this caused crashes in Snit's test suite. + 2005-08-25 Donal K. Fellows <donal.k.fellows@man.ac.uk> * generic/tclListObj.c (UpdateStringOfList): Stop uncontrolled and diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 3367af9..89a8381 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -21,7 +21,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.81 2005/07/26 16:21:31 dgp Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.82 2005/08/26 08:39:49 dkf Exp $ */ #include "tclInt.h" @@ -4895,9 +4895,12 @@ NamespaceEnsembleCmd(dummy, interp, objc, objv) Tcl_SetEnsembleUnknownHandler(interp, token, unknownObj); /* - * Tricky! Rely on the object result not being shared! + * Tricky! Must ensure that the result is not shared (command delete + * traces could have corrupted the pristine object that we started + * with). [Snit test rename-1.5] */ + Tcl_ResetResult(interp); Tcl_GetCommandFullName(interp, token, Tcl_GetObjResult(interp)); return TCL_OK; } |