diff options
author | dgp <dgp@users.sourceforge.net> | 2008-02-29 21:02:17 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-02-29 21:02:17 (GMT) |
commit | 538a92af4c40dae91012d0a2aacbee52a9ff86ca (patch) | |
tree | 4442cd726274b0a3f8231e11daaea173a6533e60 | |
parent | f971bc37c350f55dfdd2ed65cf406aa4e81feb9e (diff) | |
download | tcl-538a92af4c40dae91012d0a2aacbee52a9ff86ca.zip tcl-538a92af4c40dae91012d0a2aacbee52a9ff86ca.tar.gz tcl-538a92af4c40dae91012d0a2aacbee52a9ff86ca.tar.bz2 |
* generic/tclResult.c (Tcl_SetReturnOptions): Revised the refcount
management of Tcl_SetReturnOptions to become that of a conventional
Consumer routine. Thanks to Peter Spjuth for pointing out the
difficulties calling Tcl_SetReturnOptions with non-0-count value for
options.
* generic/tclExecute.c (INST_RETURN_STK): Revised the one caller
within Tcl itself which passes a non-0-count value to
Tcl_SetReturnOptions().
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tclExecute.c | 3 | ||||
-rw-r--r-- | generic/tclResult.c | 3 |
3 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,14 @@ 2008-02-28 Don Porter <dgp@users.sourceforge.net> + * generic/tclResult.c (Tcl_SetReturnOptions): Revised the refcount + management of Tcl_SetReturnOptions to become that of a conventional + Consumer routine. Thanks to Peter Spjuth for pointing out the + difficulties calling Tcl_SetReturnOptions with non-0-count value for + options. + * generic/tclExecute.c (INST_RETURN_STK): Revised the one caller + within Tcl itself which passes a non-0-count value to + Tcl_SetReturnOptions(). + * generic/tclBasic.c (Tcl_AppendObjToErrorInfo): Revised the refcount management of Tcl_AppendObjToErrorInfo to become that of a conventional Consumer routine. This preserves the ease of use diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 6840574..25df0e7 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.363 2008/02/04 20:24:55 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.364 2008/02/29 21:02:20 dgp Exp $ */ #include "tclInt.h" @@ -1866,6 +1866,7 @@ TclExecuteByteCode( TRACE(("=> ")); objResultPtr = POP_OBJECT(); result = Tcl_SetReturnOptions(interp, OBJ_AT_TOS); + Tcl_DecrRefCount(OBJ_AT_TOS); OBJ_AT_TOS = objResultPtr; if (result == TCL_OK) { TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")", diff --git a/generic/tclResult.c b/generic/tclResult.c index e000a19..f9ef5b6 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclResult.c,v 1.45 2007/12/13 15:23:20 dgp Exp $ + * RCS: @(#) $Id: tclResult.c,v 1.46 2008/02/29 21:02:20 dgp Exp $ */ #include "tclInt.h" @@ -1494,6 +1494,7 @@ Tcl_SetReturnOptions( int objc, level, code; Tcl_Obj **objv, *mergedOpts; + Tcl_IncrRefCount(options); if (TCL_ERROR == TclListObjGetElements(interp, options, &objc, &objv) || (objc % 2)) { Tcl_ResetResult(interp); |