summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2023-05-25 20:55:52 (GMT)
committergriffin <briang42@easystreet.net>2023-05-25 20:55:52 (GMT)
commit22306f855bf51086d44dcd3c7c48cfcca54a733e (patch)
tree95b82488cca1b7a439d7f9d4948d5f46e2775322
parent09bc3f703368aba6ab9349cb6df1f217b49d6241 (diff)
parent0657f97bc5e5f5b835c2c60713f306fb97950a89 (diff)
downloadtcl-22306f855bf51086d44dcd3c7c48cfcca54a733e.zip
tcl-22306f855bf51086d44dcd3c7c48cfcca54a733e.tar.gz
tcl-22306f855bf51086d44dcd3c7c48cfcca54a733e.tar.bz2
merge trunk, fix leak.
-rwxr-xr-xgeneric/tclArithSeries.c21
-rw-r--r--generic/tclTest.c7
-rw-r--r--generic/tclTestObj.c6
3 files changed, 26 insertions, 8 deletions
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c
index c4c65a3..f8428e6 100755
--- a/generic/tclArithSeries.c
+++ b/generic/tclArithSeries.c
@@ -913,8 +913,21 @@ TclArithSeriesGetElements(
}
/*
- * Handle ArithSeries special case - don't shimmer a series into a list
- * just to reverse it.
+ *----------------------------------------------------------------------
+ *
+ * TclArithSeriesObjReverse --
+ *
+ * Reverse the order of the ArithSeries value. The arithSeriesObj is
+ * assumed to be a valid ArithSeries. The new Obj has the Start and End
+ * values appropriately swapped and the Step value sign is changed.
+ *
+ * Results:
+ * The result will be an ArithSeries in the reverse order.
+ *
+ * Side effects:
+ * The ogiginal obj will be modified and returned if it is not Shared.
+ *
+ *----------------------------------------------------------------------
*/
int
TclArithSeriesObjReverse(
@@ -961,10 +974,6 @@ TclArithSeriesObjReverse(
TclSetIntObj(stepObj, step);
}
- Tcl_IncrRefCount(startObj);
- Tcl_IncrRefCount(endObj);
- Tcl_IncrRefCount(stepObj);
-
if (Tcl_IsShared(arithSeriesObj) ||
((arithSeriesObj->refCount > 1))) {
Tcl_Obj *lenObj;
diff --git a/generic/tclTest.c b/generic/tclTest.c
index e701834..4bfd810 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -5765,6 +5765,9 @@ TestbytestringObjCmd(
#if !defined(TCL_NO_DEPRECATED)
# if defined(_MSC_VER) && !defined(NDEBUG)
# pragma warning(disable:4133)
+# elif defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wincompatible-pointer-types"
# endif
int n; /* On purpose, not Tcl_Size, in order to demonstrate what happens */
#else
@@ -5783,6 +5786,10 @@ TestbytestringObjCmd(
if (p == NULL) {
return TCL_ERROR;
}
+#if !defined(TCL_NO_DEPRECATED) && defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
if (x.m != 1) {
Tcl_AppendResult(interp, "Tcl_GetBytesFromObj() overwrites variable", NULL);
return TCL_ERROR;
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index a669695..5271a54 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -119,8 +119,10 @@ TclObjTest_Init(
Tcl_CreateObjCommand(interp, "testobj", TestobjCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "teststringobj", TeststringobjCmd,
NULL, NULL);
- Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd,
- NULL, NULL);
+ if (sizeof(Tcl_Size) == sizeof(Tcl_WideInt)) {
+ Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd,
+ NULL, NULL);
+ }
return TCL_OK;
}