unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: documentation of integers, fixnums and bignums
Date: Sun, 09 Sep 2018 08:40:35 +0300	[thread overview]
Message-ID: <83tvmzqld8.fsf@gnu.org> (raw)
In-Reply-To: <7f7411eb-32c8-9ea6-8ead-2aaf603d3901@cs.ucla.edu> (message from Paul Eggert on Sat, 8 Sep 2018 16:37:26 -0700)

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sat, 8 Sep 2018 16:37:26 -0700
> 
> >> When INDEX_TO_CODE_POINT returns a code point greater than
> >> most-positive-fixnum, which can happen (in theory, at least) on 32-bit
> >> platforms.
> > 
> > Can it, really?
> 
> I don't know of any way it could happen. So what you're saying is that we should 
> install something like the attached patch?

The log message you made in commit 3c7649c says:

    Don't rely on undefined behavior with signed left shift overflow.
    Don't assume unsigned int fits into fixnum, or that fixnum fits
    into unsigned int.  Don't require max_code to be a valid fixnum;
    that's not true for gb10830 4-byte on a 32-bit host.

And indeed, etc/charsets/gb108304.map clearly shows codepoints like
0x81308130, which will overflow the 32-bit most-positive-fixnum.
(These codepoints are just a concatenation of the 4 bytes of the GB
10830 encoding, see https://en.wikipedia.org/wiki/GB_18030).

> Also, how about glyph-ids returned by font-variation-glyphs? Can they exceed 
> fixnum range? If not, font-variation-glyphs could see a similar speedup.

They are glyph IDs of some font.  Does anyone know what are the limits
for values of font glyph IDs?  I'm not an expert on fonts.



  parent reply	other threads:[~2018-09-09  5:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-08 16:09 documentation of integers, fixnums and bignums Paul Eggert
2018-09-08 16:27 ` Eli Zaretskii
2018-09-08 18:15   ` Stefan Monnier
2018-09-08 20:15     ` Paul Eggert
2018-09-08 22:03       ` Stefan Monnier
2018-09-08 23:37         ` Paul Eggert
2018-09-09  2:33           ` Stefan Monnier
2018-09-09  5:40           ` Eli Zaretskii [this message]
2018-09-10  0:09             ` Stefan Monnier
2018-09-10  6:43               ` Eli Zaretskii
2018-09-10 12:11                 ` Stefan Monnier
2018-09-10 13:53                   ` Eli Zaretskii
2018-09-09  5:42         ` Eli Zaretskii
2018-09-10  0:12           ` Stefan Monnier
2018-09-08 20:05   ` Paul Eggert
2018-09-08 21:07     ` Eli Zaretskii
2018-09-08 21:58     ` Stefan Monnier
     [not found] <<0f632217-27ad-4f54-8ce0-480301fa2a86@cs.ucla.edu>
     [not found] ` <<83pnxorm37.fsf@gnu.org>
2018-09-09  1:43   ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83tvmzqld8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).