diff options
author | dgp <dgp@users.sourceforge.net> | 2015-11-20 16:42:57 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-11-20 16:42:57 (GMT) |
commit | 94b81dda496d4ab92cd28c9fa1778dec5b2e8d67 (patch) | |
tree | a7f9d5de436e44a163dfaca6fba37508ef99f227 | |
parent | c3e6dcaa6708a3c30c57abc83697fea22ff77809 (diff) | |
parent | f4b65459ef36d86c50bf8b28aabd416c013b1022 (diff) | |
download | tcl-94b81dda496d4ab92cd28c9fa1778dec5b2e8d67.zip tcl-94b81dda496d4ab92cd28c9fa1778dec5b2e8d67.tar.gz tcl-94b81dda496d4ab92cd28c9fa1778dec5b2e8d67.tar.bz2 |
[40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR.
-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. |