all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Federico Tedin <federicotedin@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: casouri@gmail.com, 40000@debbugs.gnu.org
Subject: bug#40000: 27.0.60; next-single-char-property-change hangs on bad argument
Date: Mon, 13 Apr 2020 17:27:06 +0200	[thread overview]
Message-ID: <874ktn2yph.fsf@gmail.com> (raw)
In-Reply-To: <83sgh7ihj2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Apr 2020 17:31:29 +0300")

> I think this means you are dealing with "undefined behavior".  Since
> you want to make it well-defined, the results must be consistent,
> where they weren't before.
>
> Note that the doc string also says this:
>
>   In a string, scan runs to the end of the string, unless LIMIT is non-nil.
>   In a buffer, if LIMIT is nil or omitted, it runs to (point-max), and the
>   value cannot exceed that.
>
> So it's quite clear to me that the value should never be more than the
> last valid position, both for strings and for buffers.  No doubt, no
> one called this function with LIMIT beyond the last valid position,
> because that would produce an infloop.  So a change that will return
> the maximum valid position in this case cannot be
> backward-incompatible.

I agree that the function should always return equal or smaller than the
last valid position. In case of buffers, fixing LIMIT > (point-max) is
OK because the function wasn't defined for that case anyways, as you
mentioned. However I'm not sure if my patch should fix the case for
strings where LIMIT > (length object), since that would mean that the
returned value would now be (length object) instead of LIMIT. And calls
to this function with these types of values could already exist, since
in this case the function did not hang.





  reply	other threads:[~2020-04-13 15:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 15:40 bug#40000: 27.0.60; next-single-char-property-change hangs on bad argument Yuan Fu
2020-04-13 13:52 ` Federico Tedin
2020-04-13 14:04   ` Eli Zaretskii
2020-04-13 14:20     ` Federico Tedin
2020-04-13 14:31       ` Eli Zaretskii
2020-04-13 15:27         ` Federico Tedin [this message]
2020-04-13 15:54           ` Eli Zaretskii
2020-04-14 21:05             ` Federico Tedin
2020-04-25 12:23               ` Eli Zaretskii
2020-05-03 14:04                 ` Federico Tedin
2020-05-09  7:29                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ktn2yph.fsf@gmail.com \
    --to=federicotedin@gmail.com \
    --cc=40000@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.