unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36740: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant)
@ 2019-07-20 12:29 Pip Cet
  2019-07-20 13:15 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Pip Cet @ 2019-07-20 12:29 UTC (permalink / raw)
  To: 36740

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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-21 12:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-20 12:29 bug#36740: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant) Pip Cet
2019-07-20 13:15 ` 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

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).