diff options
author | dgp <dgp@users.sourceforge.net> | 2013-06-28 02:58:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-06-28 02:58:15 (GMT) |
commit | d896ae28d39cbaeb363e3b84c58c26e31bd0c56d (patch) | |
tree | c714ff80e261977e24bcb902ee1b6b45566ecdf6 /generic/tclExecute.c | |
parent | 7924f4a694c43ca8fe4260041d090795b0791a96 (diff) | |
download | tcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.zip tcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.tar.gz tcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.tar.bz2 |
More elimination of error message litter to fix [Bug 20a81392ec].
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index d3a0d32..37bf072 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -1426,17 +1426,12 @@ Tcl_NRExprObj( Tcl_Obj *resultPtr) { ByteCode *codePtr; + Tcl_InterpState state = Tcl_SaveInterpState(interp, TCL_OK); - /* TODO: consider saving whole state? */ - Tcl_Obj *saveObjPtr = Tcl_GetObjResult(interp); - - Tcl_IncrRefCount(saveObjPtr); - + Tcl_ResetResult(interp); codePtr = CompileExprObj(interp, objPtr); - /* TODO: Confirm reset not required? */ - /*Tcl_ResetResult(interp);*/ - Tcl_NRAddCallback(interp, ExprObjCallback, saveObjPtr, resultPtr, + Tcl_NRAddCallback(interp, ExprObjCallback, state, resultPtr, NULL, NULL); return TclNRExecuteByteCode(interp, codePtr); } @@ -1447,14 +1442,15 @@ ExprObjCallback( Tcl_Interp *interp, int result) { - Tcl_Obj *saveObjPtr = data[0]; + Tcl_InterpState state = data[0]; Tcl_Obj *resultPtr = data[1]; if (result == TCL_OK) { TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp)); - Tcl_SetObjResult(interp, saveObjPtr); + (void) Tcl_RestoreInterpState(interp, state); + } else { + Tcl_DiscardInterpState(state); } - TclDecrRefCount(saveObjPtr); return result; } |