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)
commitbb9a5f579a5ff3b27b944f569a9952022dc1d9fe (patch)
tree1f9ca7098989620146558e0736d079e2bad9d81f /generic/tkTextBTree.c
parent7a58a1661cb6a5bfae8a6e373c0a917598dad09c (diff)
downloadtk-bb9a5f579a5ff3b27b944f569a9952022dc1d9fe.zip
tk-bb9a5f579a5ff3b27b944f569a9952022dc1d9fe.tar.gz
tk-bb9a5f579a5ff3b27b944f569a9952022dc1d9fe.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;
}