From 3f4897852c302eb336547bdda59ab890dc43e823 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 26 Aug 2005 08:39:47 +0000 Subject: Fix crashes when running Snit's test suite caused by traces forcing the interp result object to become shared. --- ChangeLog | 7 +++++++ generic/tclNamesp.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75724ca..9c32041 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-26 Donal K. Fellows + + * 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 * 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; } -- cgit v0.12