summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-11-20 16:42:57 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-11-20 16:42:57 (GMT)
commitb043297e8b02ea12c45a49b4cea4dcaa50da99b3 (patch)
treea7f9d5de436e44a163dfaca6fba37508ef99f227 /generic
parent0c95d1d7c2d07e8a422b8af055160e8009e7eeb4 (diff)
parentc32d032cbd7947d9e64e931df87fc4f374d81e7f (diff)
downloadtcl-b043297e8b02ea12c45a49b4cea4dcaa50da99b3.zip
tcl-b043297e8b02ea12c45a49b4cea4dcaa50da99b3.tar.gz
tcl-b043297e8b02ea12c45a49b4cea4dcaa50da99b3.tar.bz2
[40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdIL.c10
-rw-r--r--generic/tclOODefineCmds.c3
-rw-r--r--generic/tclUtil.c7
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.