diff options
author | dgp <dgp@users.sourceforge.net> | 2011-03-08 15:22:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-03-08 15:22:38 (GMT) |
commit | 2dad5852c21f06c8ebad40a0acdae17b7991f3b0 (patch) | |
tree | 1114a221e975d66928fed84192cc8f71a88b3dbb | |
parent | bf203d533248ef560add28aa14207bdb91bd5a29 (diff) | |
download | tcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.zip tcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.tar.gz tcl-2dad5852c21f06c8ebad40a0acdae17b7991f3b0.tar.bz2 |
* generic/tclResult.c (ResetObjResult): Correct failure to clear
invalid intrep. Thanks to Colin McDonald. [Bug 3202905]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclResult.c | 12 |
2 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2011-03-08 Don Porter <dgp@users.sourceforge.net> + + * generic/tclResult.c (ResetObjResult): Correct failure to clear + invalid intrep. Thanks to Colin McDonald. [Bug 3202905] + 2011-03-08 Donal K. Fellows <dkf@users.sf.net> * generic/tclAssembly.c, tests/assemble.test: Migrate to use a style diff --git a/generic/tclResult.c b/generic/tclResult.c index f60ae26..2a04f18 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -980,12 +980,14 @@ ResetObjResult( TclNewObj(objResultPtr); Tcl_IncrRefCount(objResultPtr); iPtr->objResultPtr = objResultPtr; - } else if (objResultPtr->bytes != tclEmptyStringRep) { - if (objResultPtr->bytes != NULL) { - ckfree((char *) objResultPtr->bytes); + } else { + if (objResultPtr->bytes != tclEmptyStringRep) { + if (objResultPtr->bytes) { + ckfree((char *) objResultPtr->bytes); + } + objResultPtr->bytes = tclEmptyStringRep; + objResultPtr->length = 0; } - objResultPtr->bytes = tclEmptyStringRep; - objResultPtr->length = 0; TclFreeIntRep(objResultPtr); objResultPtr->typePtr = NULL; } |