diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-01-13 09:45:29 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-01-13 09:45:29 (GMT) |
commit | dc07b30d3d0a5862a722e77921624699c73b0301 (patch) | |
tree | d2a1dd959af85f65851a57e2e569b3e9fffd3128 | |
parent | 0bec7f138e8a3b292c93878d0cb0f485177c5880 (diff) | |
download | tcl-dc07b30d3d0a5862a722e77921624699c73b0301.zip tcl-dc07b30d3d0a5862a722e77921624699c73b0301.tar.gz tcl-dc07b30d3d0a5862a722e77921624699c73b0301.tar.bz2 |
Fix shared object panics. [Bug 875395]
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tclIndexObj.c | 9 |
2 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2004-01-13 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tclIndexObj.c (Tcl_GetIndexFromObjStruct, Tcl_WrongNumArgs): + Create fresh objects instead of using the one currently in the + interpreter, which isn't guaranteed to be fresh and unshared. The + cost for the core will be minimal because of the object cache, and + this fixes [Bug 875395]. + 2004-01-09 Vince Darley <vincentdarley@users.sourceforge.net> * generic/tclIOUtil.c: fix to infinite loop in diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 5891aeb..60d4931 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIndexObj.c,v 1.16 2002/02/28 05:11:25 dgp Exp $ + * RCS: @(#) $Id: tclIndexObj.c,v 1.16.2.1 2004/01/13 09:45:30 dkf Exp $ */ #include "tclInt.h" @@ -271,7 +271,9 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, * Produce a fancy error message. */ int count; - resultPtr = Tcl_GetObjResult(interp); + + TclNewObj(resultPtr); + Tcl_SetObjResult(interp, resultPtr); Tcl_AppendStringsToObj(resultPtr, (numAbbrev > 1) ? "ambiguous " : "bad ", msg, " \"", key, "\": must be ", STRING_AT(tablePtr,offset,0), (char*)NULL); @@ -450,7 +452,8 @@ Tcl_WrongNumArgs(interp, objc, objv, message) int i; register IndexRep *indexRep; - objPtr = Tcl_GetObjResult(interp); + TclNewObj(objPtr); + Tcl_SetObjResult(interp, objPtr); Tcl_AppendToObj(objPtr, "wrong # args: should be \"", -1); for (i = 0; i < objc; i++) { /* |