diff options
-rw-r--r-- | generic/tclCmdAH.c | 1 | ||||
-rw-r--r-- | tests/cmdAH.test | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 8e32389..44f08a3 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -273,7 +273,6 @@ Tcl_CatchObjCmd( Tcl_Obj *options = Tcl_GetReturnOptions(interp, result); if (NULL == Tcl_ObjSetVar2(interp, optionVarNamePtr, NULL, options, 0)) { - Tcl_DecrRefCount(options); Tcl_ResetResult(interp); Tcl_AppendResult(interp, "couldn't save return options in variable", NULL); diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 2e94d7d..fb0fefc 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -46,6 +46,12 @@ test cmdAH-1.2 {Tcl_CatchObjCmd, errors} { test cmdAH-1.3 {Tcl_CatchObjCmd, errors} { list [catch {catch foo bar baz spaz} msg] $msg } {1 {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"}} +test cmdAH-1.4 {Bug 3595576} { + catch {catch {} -> noSuchNs::var} +} 1 +test cmdAH-1.5 {Bug 3595576} { + catch {catch error -> noSuchNs::var} +} 1 test cmdAH-2.1 {Tcl_CdObjCmd} { list [catch {cd foo bar} msg] $msg |