• Paul Eggert's avatar
    * bidi.c: Integer size and overflow fixes. · 39e378da
    Paul Eggert authored
    (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
    (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
    (bidi_cache_find_level_change, bidi_cache_ensure_space)
    (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
    Use ptrdiff_t instead of EMACS_INT where either will do.
    This works better on 32-bit hosts configured --with-wide-int.
    (bidi_cache_ensure_space): Check for size-calculation overflow.
    Use % rather than repeated addition, for better worst-case speed.
    Don't set bidi_cache_size until after xrealloc returns, because it
    might not return.
    (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
bidi.c 74.5 KB