bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#32038: 27.0.50; Emacs hangs when using :propertize mode line constru


From: Eli Zaretskii
Subject: bug#32038: 27.0.50; Emacs hangs when using :propertize mode line construct and not providing a property value
Date: Wed, 04 Jul 2018 18:07:23 +0300

> From: Jonathan Kyle Mitchell <kyle@jonathanmitchell.org>
> Date: Tue, 03 Jul 2018 22:12:57 -0500
> Cc: 32038@debbugs.gnu.org
> 
> I think I found a way to make redisplay ignore any malformed property list by
> putting a single check around Fset_text_properties in xdisp.c. The text of the
> modeline is still set according to the provided string, but the property list
> is ignored if it doesn't have an even number of elements. It doesn't
> infinitely loop anymore given a malformed property list.

Thanks, but I think we should log the error in *Messages*, because
otherwise the error will go unnoticed.

> +                 if (EQ (Fmod (Flength (props), make_number (2)),
> +                         make_number (0)))

We are on the C level, so it is easier/simpler to do this instead:

  ptrdiff_t seqlen = XFASTINT (Flength (props));
  if (seqlen % 2 == 0)
    Fset_text_properties (...);

More importantly, Flength can signal an error if PROPS is too long, so
I'm not sure the idea of your patch is 100% correct, because the code
you propose can still signal an error.  An alternative would be to
call Fset_text_properties via internal_condition_case_n, like we do in
safe__call.





reply via email to

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