Tk Source Code

View Ticket
Login
Ticket UUID: e4ed00a954e1712068e1b419b56f7ed3e026b767
Title: ".t index $ind display wordstart" crashes
Type: Bug Version: trunk
Submitter: fvogel Created on: 2015-04-08 19:21:35
Subsystem: 18. [text] Assigned To: fvogel
Priority: 8 Severity: Minor
Status: Closed Last Modified: 2015-04-09 12:39:13
Resolution: Fixed Closed By: dgp
    Closed on: 2015-04-09 12:39:13
Description:
package require Tk
text .t
.t index "1.0 display wordstart"  ; # crashes!
User Comments: dgp added on 2015-04-09 12:39:13:
merged to main branches

fvogel added on 2015-04-08 19:33:56:
Fix and test case proposed in branch bug-e4ed00a954

fvogel added on 2015-04-08 19:25:17:
Cause is in function StartEnd:2343

	    TkTextIndexForwChars(NULL, indexPtr, 0, indexPtr,
		    COUNT_DISPLAY_INDICES);

Calling TkTextIndexForwChars with simultaneous NULL as textPtr (1st argument) and COUNT_DISPLAY_INDICES as type shall never happen.

In such a case TkTextIndexForwChars calls TkTextIsElided, which wants a real (non-NULL) textPtr.