Mike Kupfer writes:
I am a little puzzled by this code in pixel_to_glyph_translation():
for (*col = 0; *col <= Dynarr_length (db->runes); (*col)++)
This looks to me like somebody was trying to be too tricky.
Dynarr_length(db-runes) is presumably an invalid index.
I guess you can't determine what the type of the display block that
caused the fault is?
{
int past_end = (*col == Dynarr_length (db->runes));
[...]
if (past_end || ...)
{
if (past_end)
{
(*col)--;
rb = Dynarr_atp (db->runes, *col);
}
The Dynarr_atp() call is where XEmacs died, with *col == -1.
If db->runes is zero-length, then past_end will be true on the first
pass through the loop. We will then decrement *col and then die in the
inline code from Dynarr_verify_pos_atp().
Either the code needs to handle a zero-length db->runes, or
db->runes is assumed to have a non-zero length. I suspect it's the
former, because earlier code in pixel_to_glyph_translation() allows for
a zero-length db->runes.
You're right. get_display_block_from_line() at l.9080 will always
return a display block, but it might be a new (empty) one.
I would suggest testing for Dynarr_length(db->runes) && *col <=
Dynarr_length(db-runes), but what do I know? :-)
Can typeahead cause any problems here?
I don't know, but I would hope not. Typeahead will result in events
in the queue, but redisplay should ignore those. That's the whole
point of event-driven programming, to get the asynchronous stuff out
of the way of the hairy calculation stuff. :-)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta