Subject: bug#24368: 25.1; Assertion failure in attach_marker

From: Eli Zaretskii <[email-masked]>
Date: Mon, 05 Sep 2016 19:25:56 +0300

> Date: Mon, 05 Sep 2016 17:04:08 +0200
> From: martin rudalics <[email-masked]>
> 
> FWIW, in attach_marker if m->buffer != b the check
> 
>    if (BUF_Z (b) == BUF_Z_BYTE (b))
>      eassert (charpos == bytepos);
>    else
>      eassert (charpos <= bytepos);
> 
> will fail when b has the same char and byte sizes but charpos and
> bytepos differ in m->buffer (like *Help* with its various quotes).  A
> thinko.

Obviously, the BUF_z vs BUF_Z_BYTE test should be done for the same
buffer whose character and byte positions we compare in the
assertions.