emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text-property/intervals question


From: Stefan Monnier
Subject: Re: text-property/intervals question
Date: Mon, 26 Nov 2001 17:18:10 -0500

>     --- intervals.c.~1.109.~  Mon Nov 12 20:06:41 2001
>     +++ intervals.c   Sun Nov 25 21:15:13 2001
>     @@ -1690,7 +1690,7 @@
>        if (NULL_INTERVAL_P (source))
>        {
>          Lisp_Object buf;
>     -      if (!inherit && ! NULL_INTERVAL_P (tree))
>     +      if (!inherit && !NULL_INTERVAL_P (tree) && length > 0)
>           {
>             XSETBUFFER (buf, buffer);
>             set_text_properties_1 (make_number (position),
> 
> Yes, it looks like this code could have created a zero-length interval
> when there wasn't already one.
> 
> I will change set_text_properties_1 so it is safe in strange situations.

I checked all the callers (there are only two callers to
set_text_properties_1) and there is no strange situation
(the reason why the other caller is safe is somewhat intricate
and relies on the precise behavior of validate-interval-range).

I added the `eassert' and the documentation to make sure that
new strange situations are not introduced in the future.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]