unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: 36740@debbugs.gnu.org
Subject: bug#36740: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant)
Date: Sat, 20 Jul 2019 12:29:57 +0000	[thread overview]
Message-ID: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@mail.gmail.com> (raw)

This code in ccl.c

        eop = hash_lookup (h, make_fixnum (reg[RRR]), NULL);
        if (eop >= 0)
          {
            Lisp_Object opl;
            opl = HASH_VALUE (h, eop);
            if (! (IN_INT_RANGE (eop) && CHARACTERP (opl)))
              CCL_INVALID_CMD;
            reg[RRR] = charset_unicode;
            reg[rrr] = eop;
            reg[7] = 1; /* r7 true for success */
          }
        else
          reg[7] = 0;

seems wrong to me. We look up the hash value for reg[RRR], but then we
store the hash _index_ into reg[rrr], and throw away the actual value.

The bug appears to be present in:

commit d325055a00e658a38c1721fcc63ed1775dd8ccb3
Author: Dave Love <fx@gnu.org>
Date:   Tue Jul 30 11:31:54 2002 +0000

which added the code, so I'm not sure whether there's external code
which might rely on the buggy behavior (unlikely, I think). Is there
any code actually making use of this CCL feature?

I'm playing around with hash tables and it would help to resolve this first.





             reply	other threads:[~2019-07-20 12:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20 12:29 Pip Cet [this message]
2019-07-20 13:15 ` bug#36740: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant) Eli Zaretskii
2019-07-20 13:23   ` Eli Zaretskii
2019-07-20 13:51   ` Eli Zaretskii
2019-07-20 14:58     ` Pip Cet
2019-07-20 18:59       ` Andy Moreton
2019-07-20 20:18         ` Pip Cet
2019-07-20 22:48           ` Andy Moreton
2019-07-21  6:01             ` Pip Cet
2019-08-01 17:14               ` Noam Postavsky
2020-08-21 12:48               ` Lars Ingebrigtsen

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='CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=36740@debbugs.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 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).