diff options
-rw-r--r-- | generic/tclCmdIL.c | 10 | ||||
-rw-r--r-- | generic/tclOODefineCmds.c | 3 | ||||
-rw-r--r-- | generic/tclUtil.c | 7 |
3 files changed, 17 insertions, 3 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index d723e4b..739dca9 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2390,7 +2390,10 @@ Tcl_LinsertObjCmd( Tcl_ListObjAppendElement(NULL, listPtr, objv[3]); } else { - Tcl_ListObjReplace(NULL, listPtr, index, 0, (objc-3), &(objv[3])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, index, 0, + (objc-3), &(objv[3]))) { + return TCL_ERROR; + } } /* @@ -2786,7 +2789,10 @@ Tcl_LreplaceObjCmd( * optimize this case away. */ - Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, objv+4); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, first, numToDelete, + objc-4, objv+4)) { + return TCL_ERROR; + } /* * Set the interpreter's object result. diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index c3184be..85f6c31 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -887,6 +887,7 @@ TclOODefineObjCmd( Tcl_GetCommandFullName(interp, cmd, obj2Ptr); } Tcl_ListObjAppendElement(NULL, objPtr, obj2Ptr); + /* TODO: overflow? */ Tcl_ListObjReplace(NULL, objPtr, 1, 0, objc-3, objv+3); Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); @@ -1001,6 +1002,7 @@ TclOOObjDefObjCmd( Tcl_GetCommandFullName(interp, cmd, obj2Ptr); } Tcl_ListObjAppendElement(NULL, objPtr, obj2Ptr); + /* TODO: overflow? */ Tcl_ListObjReplace(NULL, objPtr, 1, 0, objc-3, objv+3); Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); @@ -1115,6 +1117,7 @@ TclOODefineSelfObjCmd( Tcl_GetCommandFullName(interp, cmd, obj2Ptr); } Tcl_ListObjAppendElement(NULL, objPtr, obj2Ptr); + /* TODO: overflow? */ Tcl_ListObjReplace(NULL, objPtr, 1, 0, objc-2, objv+2); Tcl_ListObjGetElements(NULL, objPtr, &dummy, &objs); diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 8de0267..2b0fb72 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1981,7 +1981,11 @@ Tcl_ConcatObj( continue; } if (resPtr) { - Tcl_ListObjAppendList(NULL, resPtr, objPtr); + if (TCL_OK != Tcl_ListObjAppendList(NULL, resPtr, objPtr)) { + /* Abandon ship! */ + Tcl_DecrRefCount(resPtr); + goto slow; + } } else { resPtr = TclListObjCopy(NULL, objPtr); } @@ -1992,6 +1996,7 @@ Tcl_ConcatObj( return resPtr; } + slow: /* * Something cannot be determined to be safe, so build the concatenation * the slow way, using the string representations. |