summaryrefslogtreecommitdiffstats
path: root/generic/tkTextBTree.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2012-01-31 22:24:11 (GMT)
committerfvogel <fvogelnew1@free.fr>2012-01-31 22:24:11 (GMT)
commit7664c99658c07b63bcdfc3827dd74d8da19ef1fd (patch)
tree1f9ca7098989620146558e0736d079e2bad9d81f /generic/tkTextBTree.c
parentb4f5df095c7b84b7aa277daf88a07e38f6e03abc (diff)
downloadtk-7664c99658c07b63bcdfc3827dd74d8da19ef1fd.zip
tk-7664c99658c07b63bcdfc3827dd74d8da19ef1fd.tar.gz
tk-7664c99658c07b63bcdfc3827dd74d8da19ef1fd.tar.bz2
[Bug-1630262]: segfault when deleting lines with peer text widgets
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r--generic/tkTextBTree.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index 0038e64..005ce46 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -662,12 +662,12 @@ AdjustStartEndRefs(
if (textPtr->start != NULL) {
count--;
treePtr->startEnd[count] = textPtr->start;
- treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers;
+ treePtr->startEndRef[count] = textPtr;
}
if (textPtr->end != NULL) {
count--;
treePtr->startEnd[count] = textPtr->end;
- treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers;
+ treePtr->startEndRef[count] = textPtr;
}
}
}
@@ -1609,7 +1609,7 @@ TkBTreeFindLine(
}
/*
- * Check for the any start/end offset for this text widget.
+ * Check for any start/end offset for this text widget.
*/
if (textPtr != NULL) {
@@ -1993,6 +1993,11 @@ TkBTreeLinesTo(
}
if (textPtr != NULL && textPtr->start != NULL) {
index -= TkBTreeLinesTo(NULL, textPtr->start);
+ if (index < 0) {
+ /* One should panic here!
+ Tcl_Panic("TkBTreeLinesTo: linePtr comes before -startline");
+ */
+ }
}
return index;
}