summaryrefslogtreecommitdiffstats
path: root/generic/tclArithSeries.c
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2022-10-04 20:15:38 (GMT)
committergriffin <briang42@easystreet.net>2022-10-04 20:15:38 (GMT)
commit00199ad335823ec6b18983d1188f70b0b065b25e (patch)
tree653e3e736d41b37f57243571ac31611295b8b4bf /generic/tclArithSeries.c
parentf852823f2d4d5f92dee67e03cbdc4da22d8be30b (diff)
downloadtcl-00199ad335823ec6b18983d1188f70b0b065b25e.zip
tcl-00199ad335823ec6b18983d1188f70b0b065b25e.tar.gz
tcl-00199ad335823ec6b18983d1188f70b0b065b25e.tar.bz2
Fix some bugs in lseq
Diffstat (limited to 'generic/tclArithSeries.c')
-rwxr-xr-xgeneric/tclArithSeries.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c
index ee201fa..6a02caa 100755
--- a/generic/tclArithSeries.c
+++ b/generic/tclArithSeries.c
@@ -392,7 +392,6 @@ TclArithSeriesObjStep(
} else {
*stepObj = Tcl_NewWideIntObj(arithSeriesRepPtr->step);
}
- Tcl_IncrRefCount(*stepObj);
return TCL_OK;
}
@@ -437,7 +436,6 @@ TclArithSeriesObjIndex(Tcl_Obj *arithSeriesPtr, Tcl_WideInt index, Tcl_Obj **ele
} else {
*elementObj = Tcl_NewWideIntObj(ArithSeriesIndexM(arithSeriesRepPtr, index));
}
- Tcl_IncrRefCount(*elementObj);
return TCL_OK;
}
@@ -724,8 +722,11 @@ TclArithSeriesObjRange(
}
TclArithSeriesObjIndex(arithSeriesPtr, fromIdx, &startObj);
+ Tcl_IncrRefCount(startObj);
TclArithSeriesObjIndex(arithSeriesPtr, toIdx, &endObj);
+ Tcl_IncrRefCount(endObj);
TclArithSeriesObjStep(arithSeriesPtr, &stepObj);
+ Tcl_IncrRefCount(stepObj);
if (Tcl_IsShared(arithSeriesPtr) ||
((arithSeriesPtr->refCount > 1))) {
@@ -856,6 +857,7 @@ TclArithSeriesGetElements(
}
return TCL_ERROR;
}
+ Tcl_IncrRefCount(objv[i]);
}
}
} else {
@@ -912,8 +914,11 @@ TclArithSeriesObjReverse(
len = arithSeriesRepPtr->len;
TclArithSeriesObjIndex(arithSeriesPtr, (len-1), &startObj);
+ Tcl_IncrRefCount(startObj);
TclArithSeriesObjIndex(arithSeriesPtr, 0, &endObj);
+ Tcl_IncrRefCount(endObj);
TclArithSeriesObjStep(arithSeriesPtr, &stepObj);
+ Tcl_IncrRefCount(stepObj);
if (isDouble) {
Tcl_GetDoubleFromObj(NULL, startObj, &dstart);