summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdAH.c17
-rw-r--r--generic/tclCmdIL.c6
2 files changed, 14 insertions, 9 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index b2b1a61..e2186ed 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -27,9 +27,9 @@
struct ForeachState {
Tcl_Obj *bodyPtr; /* The script body of the command. */
- int bodyIdx; /* The argument index of the body. */
- int j, maxj; /* Number of loop iterations. */
- int numLists; /* Count of value lists. */
+ Tcl_Size bodyIdx; /* The argument index of the body. */
+ Tcl_Size j, maxj; /* Number of loop iterations. */
+ Tcl_Size numLists; /* Count of value lists. */
Tcl_Size *index; /* Array of value list indices. */
Tcl_Size *varcList; /* # loop variables per list. */
Tcl_Obj ***varvList; /* Array of var name lists. */
@@ -2733,7 +2733,8 @@ EachloopCmd(
{
int numLists = (objc-2) / 2;
struct ForeachState *statePtr;
- int i, j, result;
+ int i, result;
+ Tcl_Size j;
if (objc < 4 || (objc%2 != 0)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2887,8 +2888,12 @@ ForeachLoopStep(
break;
case TCL_OK:
if (statePtr->resultList != NULL) {
- Tcl_ListObjAppendElement(interp, statePtr->resultList,
- Tcl_GetObjResult(interp));
+ result = Tcl_ListObjAppendElement(
+ interp, statePtr->resultList, Tcl_GetObjResult(interp));
+ if (result != TCL_OK) {
+ /* e.g. memory alloc failure on big data tests */
+ goto done;
+ }
}
break;
case TCL_BREAK:
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index f7ec027..c5a6616 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2923,7 +2923,7 @@ Tcl_LrepeatObjCmd(
Tcl_Obj *const objv[])
/* The argument objects. */
{
- int elementCount, i, totalElems;
+ Tcl_Size elementCount, i, totalElems;
Tcl_Obj *listPtr, **dataArray = NULL;
/*
@@ -2935,7 +2935,7 @@ Tcl_LrepeatObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "count ?value ...?");
return TCL_ERROR;
}
- if (TCL_OK != TclGetIntFromObj(interp, objv[1], &elementCount)) {
+ if (TCL_OK != TclGetSizeIntFromObj(interp, objv[1], &elementCount)) {
return TCL_ERROR;
}
if (elementCount < 0) {
@@ -2997,7 +2997,7 @@ Tcl_LrepeatObjCmd(
dataArray[i] = tmpPtr;
}
} else {
- int j, k = 0;
+ Tcl_Size j, k = 0;
for (i=0 ; i<elementCount ; i++) {
for (j=0 ; j<objc ; j++) {