From: Wilfred Hughes <me@wilfred.me.uk>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 25684@debbugs.gnu.org
Subject: bug#25684: 25.1; (downcase -1) segfaults Emacs on GNU/Linux
Date: Wed, 15 Feb 2017 22:48:49 +0000 [thread overview]
Message-ID: <CAFXAjY4hhJdiunDVdt5vGrRbTHp5d3epwSRuMkMCi6SNCXxUvw@mail.gmail.com> (raw)
In-Reply-To: <87r33095l3.fsf@linux-m68k.org>
When I tested it on OS X, (downcase -1) returned -1.
I agree with Glenn that I think the most sensible behaviour would be
to signal a type error. I don't believe the manual specifies this
behaviour: https://www.gnu.org/software/emacs/manual/html_node/elisp/Case-Conversion.html
so it's unlikely users depend on this.
On 14 February 2017 at 15:04, Andreas Schwab <schwab@linux-m68k.org> wrote:
> On Feb 13 2017, Glenn Morris <rgm@gnu.org> wrote:
>
>> Wilfred Hughes wrote:
>>
>>> The elisp primitives downcase and upcase cause Emacs to segfault when
>>> given a negative argument. For example, (downcase -1).
>>>
>>> I can reproduce this on Emacs 25.1 as well as on master. It occurs on
>>> GNU/Linux but not on OS X.
>>
>> I can't reproduce this, but it seems to me that (downcase -1) should
>> signal a wrong-type-argument error, since negative numbers are not characters.
>> But I think there are probably subtleties here that I don't get.
>
> The function uses XFASTINT, which only works for non-negative numbers.
> This is checked when runtime checking is enabled.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
next prev parent reply other threads:[~2017-02-15 22:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-11 0:01 bug#25684: 25.1; (downcase -1) segfaults Emacs on GNU/Linux Wilfred Hughes
2017-02-13 21:29 ` Glenn Morris
2017-02-14 15:04 ` Andreas Schwab
2017-02-15 22:48 ` Wilfred Hughes [this message]
2017-02-17 4:28 ` Glenn Morris
[not found] ` <handler.25684.D25684.148730571014808.notifdone@debbugs.gnu.org>
2017-02-17 8:17 ` bug#25684: closed (Re: bug#25684: 25.1; (downcase -1) segfaults Emacs on GNU/Linux) Wilfred Hughes
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=CAFXAjY4hhJdiunDVdt5vGrRbTHp5d3epwSRuMkMCi6SNCXxUvw@mail.gmail.com \
--to=me@wilfred.me.uk \
--cc=25684@debbugs.gnu.org \
--cc=schwab@linux-m68k.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.