GNU bug report logs - #36740
27.0.50; apparently buggy code in ccl.c (lookup-integer-constant)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Pip Cet <pipcet@HIDDEN>; dated Sat, 20 Jul 2019 12:31:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 1 Aug 2019 17:14:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 13:14:51 2019
Received: from localhost ([127.0.0.1]:55097 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htEfD-00056k-98
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 13:14:51 -0400
Received: from mail-io1-f54.google.com ([209.85.166.54]:37120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1htEfB-00056X-5P
 for 36740 <at> debbugs.gnu.org; Thu, 01 Aug 2019 13:14:50 -0400
Received: by mail-io1-f54.google.com with SMTP id q22so26216102iog.4
 for <36740 <at> debbugs.gnu.org>; Thu, 01 Aug 2019 10:14:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=WzN5bVRq1QLBYQh2Uql/QT8VTEpOhAUlb+5o53Kr/kE=;
 b=kQQsEfjNf//zznJhXni4ijnjDgjJiVdAP5OZipUOv2Q0xcZR4Tobat6RQ0ioQoM6IO
 U2o5baofOMhxh3JeXPfvi/7ZUSbTAAQKBmRgxoRSM6iWFBW5odqHre4PA2fFLFj3bTpG
 spi8lfRAtSsyC0JmhgoExsuWwM3RTWu1cg8+0WZ4zq2BmbBSCmO2IFLvJPNVmBkjulPm
 t8dEqqBMaRgxxN/VmrUxudI93SatvBX+VZwzU6B/6su9Am2gt5tsyjVeDWIbzlbRM4UM
 WpzjT1/jj+nONGgFw8EaQL0cKrU4v7LabCNefWne347mzTNuHVbOkdAVq9aRXZ8kNAk/
 INsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=WzN5bVRq1QLBYQh2Uql/QT8VTEpOhAUlb+5o53Kr/kE=;
 b=iCxStPAMBS431eJrFJx4xk7j3eGqkoX78asxsxO9kJsd+aqf2s8FGZaMHeNak20EIb
 Xwf+dfTUBC2tX8FqCtrgih6zydwGKiKp36uZPZMNnAuzWF2RkXEiHRmDWC/oI+tUhoaJ
 C4UqpjVyeotKwuLPihiqJY9VRnQ8fsepfmOGqLfT+ROheM2TsxAwgO8kVTOwE8Qgr0XI
 cMPPE8IRMOkB61O/VZZkWRyOCx6e2JgHrUrx2KiQZmG0VYmvG6u7368CYto1oU4zMY+q
 mohJ320djx0nWP+SLYiC2uhMQtlDbovPrNvTl2a9u5s4e4HsDNUnURVAQI9Z+P3eDyxo
 BRuA==
X-Gm-Message-State: APjAAAUeZXeio1oKjuJIi3Uxl106PtbqSaRXvBAgjyEjb5eihTkPsFvb
 0u636+4MOumIt8SvgRNE74jTB6OQ
X-Google-Smtp-Source: APXvYqyAjsI0IbwV7V2GuMzv+DXC7DDyV/Zv94XWXrIEY/C4hZt+22vTZS0VeDpMJWhBg4ssGFdO3A==
X-Received: by 2002:a6b:b593:: with SMTP id
 e141mr126186900iof.203.1564679683097; 
 Thu, 01 Aug 2019 10:14:43 -0700 (PDT)
Received: from vhost2
 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196])
 by smtp.gmail.com with ESMTPSA id h18sm56715671iob.80.2019.08.01.10.14.42
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 01 Aug 2019 10:14:42 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Pip Cet <pipcet@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
References: <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
 <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
 <86tvbgfs6g.fsf@HIDDEN>
 <CAOqdjBfgCeQx8bmyuJWGB7xjFrTuOrX-+JQhanmj-6eKXhg_vg@HIDDEN>
 <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <86o91oxqyp.fsf@HIDDEN>
 <CAOqdjBeSrUuTsuDZYWVm_KKT8cWtw6Q3HB=oPMxV3Qeq-BeGcg@HIDDEN>
Date: Thu, 01 Aug 2019 13:14:43 -0400
In-Reply-To: <CAOqdjBeSrUuTsuDZYWVm_KKT8cWtw6Q3HB=oPMxV3Qeq-BeGcg@HIDDEN> (Pip
 Cet's message of "Sun, 21 Jul 2019 06:01:10 +0000")
Message-ID: <85d0ho4xks.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36740
Cc: 36740 <at> debbugs.gnu.org, Andy Moreton <andrewjmoreton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Pip Cet <pipcet@HIDDEN> writes:

> Note that the test leaks entries in translation-hash-table-vector, but
> I think it's cleaner to start with a new symbol each time we run the
> test.

I don't really see the point in using a fresh symbol here; but if you do
insist on that, let-binding translation-hash-table-vector should stop
the leak, right?

> +(ert-deftest ccl-hash-table ()
> +  (let ((sym (gensym))
> +        (table (make-hash-table :test 'eq)))
> +    (puthash 16 17 table)
> +    (puthash 17 16 table)
> +    (define-translation-hash-table sym table)
> +    (let* ((prog `(2
> +                   ((loop
> +                     (lookup-integer ,sym r0 r1)))))
> +           (compiled (ccl-compile prog))
> +           (registers [17 0 0 0 0 0 0 0]))
> +      (ccl-execute compiled registers)
> +      (should (equal registers [2 16 0 0 0 0 0 1])))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 21 Jul 2019 06:01:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 21 02:01:53 2019
Received: from localhost ([127.0.0.1]:58076 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hp4uv-0003Wg-Cy
	for submit <at> debbugs.gnu.org; Sun, 21 Jul 2019 02:01:53 -0400
Received: from mail-ot1-f44.google.com ([209.85.210.44]:33538)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pipcet@HIDDEN>) id 1hp4uu-0003WS-0u
 for 36740 <at> debbugs.gnu.org; Sun, 21 Jul 2019 02:01:52 -0400
Received: by mail-ot1-f44.google.com with SMTP id q20so36890691otl.0
 for <36740 <at> debbugs.gnu.org>; Sat, 20 Jul 2019 23:01:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=TCKwNMd5VagGSVc9y7HUt9iX/P/iOwXnWUluUKAeJZA=;
 b=ERrcyslGiwc6U4OP/TLmVSf4Sidf4XeTxd6X/Lz1HzV+Uc54uU++IxPkt2CwQ+O/WP
 IKp87Od739f6VYSbAGoQXy32Rnz/9D9Htdh1Kaddmjw3KJ5yIuLYn+2ZO0o+eXmIcIjv
 HO891qKS9hXZDYzFRit0xaySC0J18pcOD1MPYrsL+x5tsOgrvijpC8Vgv8VO3O+3u0Js
 JjxOfRmQFKG4jOzkfGNMkRXpb7BC1x/ZuEJtqoU9HVIJEc1WpI0R1JijHKUc9qtLX2h3
 DtOZrWL005S28djPmzNRV9CvswwlEFlXnTBJ3CBalaN5L9lDHdHN5bLhVjR69XCjEB3M
 HJcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=TCKwNMd5VagGSVc9y7HUt9iX/P/iOwXnWUluUKAeJZA=;
 b=rSMSn/LPXsIVa3SBcLKnYy77G/1XxcQcvATookFrY25F/+zaZ6giQNBf15zT2oyXYL
 7UHHZ6kUmlWNO/+uaxb0sYdcfuNxZ2EXecMA8PYc7LWokPVs6hof8z6HSVwXU9qSWhQ9
 FYL4Eo/wbdEWLk/mfaiAgcX8m9C4br7f7DXn+WK35u16rNAljpCi3zUxhHG+cc5oxDIc
 xBH/rLMrzGWdJm/eH9WKIsHYTIsvuTIZ0+wBT5kfjPH12S7IjbMlNU9uhOMOonxZx/1o
 wLUMX/N48g9DKJVe+c7sI4nKTQwUr8JCUADNTC+oj4CWJ57l30Y5Og9IcAz1FfO+x0fb
 wXOg==
X-Gm-Message-State: APjAAAXyJNZ7G48llUVpqAKU9q2FU4JYEUNbE6fYEhJLxFqXACFuPzpE
 34innHbDtYU01tNqbLuGP3k4T9kKDBDxTTw8p6c=
X-Google-Smtp-Source: APXvYqzu7BtnBXdzueBSchIpL8lY6tJtxC7KBwFvkcjk6XtaoXjuuRdSKfXDylbjwa5EMieXaJdnnWfp3ScFkcGxUv8=
X-Received: by 2002:a9d:744f:: with SMTP id p15mr24200339otk.287.1563688906430; 
 Sat, 20 Jul 2019 23:01:46 -0700 (PDT)
MIME-Version: 1.0
References: <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
 <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
 <86tvbgfs6g.fsf@HIDDEN>
 <CAOqdjBfgCeQx8bmyuJWGB7xjFrTuOrX-+JQhanmj-6eKXhg_vg@HIDDEN>
 <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <86o91oxqyp.fsf@HIDDEN>
In-Reply-To: <86o91oxqyp.fsf@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Date: Sun, 21 Jul 2019 06:01:10 +0000
Message-ID: <CAOqdjBeSrUuTsuDZYWVm_KKT8cWtw6Q3HB=oPMxV3Qeq-BeGcg@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
To: Andy Moreton <andrewjmoreton@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000ceb3bf058e2ab1df"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36740
Cc: 36740 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ceb3bf058e2ab1df
Content-Type: text/plain; charset="UTF-8"

On Sat, Jul 20, 2019 at 10:49 PM Andy Moreton <andrewjmoreton@HIDDEN> wrote:
> >  (defun ccl-fixnum (code)
> >    "Convert a CCL code word to a fixnum value."
> > -  (- (logxor (logand code #x0fffffff) #x08000000) #x08000000))
> > +  (if (integerp code)
> > +      (- (logxor (logand code #x0fffffff) #x08000000) #x08000000)
> > +    code))
>
> `ccl-fixnum' should only receive integer arguments, so perhaps this fix
> should go in the call in `ccl-embed-data' instead:
>
>     (aset ccl-program-vector ccl-current-ic
>       (if (numberp data) (ccl-fixnum data) data))

Agreed, revised patch attached.

Note that the test leaks entries in translation-hash-table-vector, but
I think it's cleaner to start with a new symbol each time we run the
test.

--000000000000ceb3bf058e2ab1df
Content-Type: text/x-patch; charset="US-ASCII"; 
	name="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Disposition: attachment; 
	filename="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_jycjyzjb0>
X-Attachment-Id: f_jycjyzjb0

RnJvbSA5MTM4M2Q2YWExOTAwYzQyNmIwYzg3NmUyZmVlZjA0MjY5YzJmZDE1IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQ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GUpCiAgICAgKHNob3VsZCAoZXF1YWwgKGJ1
ZmZlci1zdHJpbmcpIHByb2ctbWlkaS1kdW1wKSkpKQorCisoZXJ0LWRlZnRlc3QgY2NsLWhhc2gt
dGFibGUgKCkKKyAgKGxldCAoKHN5bSAoZ2Vuc3ltKSkKKyAgICAgICAgKHRhYmxlIChtYWtlLWhh
c2gtdGFibGUgOnRlc3QgJ2VxKSkpCisgICAgKHB1dGhhc2ggMTYgMTcgdGFibGUpCisgICAgKHB1
dGhhc2ggMTcgMTYgdGFibGUpCisgICAgKGRlZmluZS10cmFuc2xhdGlvbi1oYXNoLXRhYmxlIHN5
bSB0YWJsZSkKKyAgICAobGV0KiAoKHByb2cgYCgyCisgICAgICAgICAgICAgICAgICAgKChsb29w
CisgICAgICAgICAgICAgICAgICAgICAobG9va3VwLWludGVnZXIgLHN5bSByMCByMSkpKSkpCisg
ICAgICAgICAgIChjb21waWxlZCAoY2NsLWNvbXBpbGUgcHJvZykpCisgICAgICAgICAgIChyZWdp
c3RlcnMgWzE3IDAgMCAwIDAgMCAwIDBdKSkKKyAgICAgIChjY2wtZXhlY3V0ZSBjb21waWxlZCBy
ZWdpc3RlcnMpCisgICAgICAoc2hvdWxkIChlcXVhbCByZWdpc3RlcnMgWzIgMTYgMCAwIDAgMCAw
IDFdKSkpKSkKLS0gCjIuMjIuMAoK
--000000000000ceb3bf058e2ab1df--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jul 2019 22:48:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 18:48:46 2019
Received: from localhost ([127.0.0.1]:57986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hoy9l-0007nF-RY
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 18:48:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:38343)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hoy9k-0007n8-KO
 for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 18:48:44 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51821)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hoy9j-0003AF-Io
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 18:48:44 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM,
 RDNS_DYNAMIC autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hoy9i-00029H-KT
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 18:48:43 -0400
Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:33074
 helo=blaine.gmane.org)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1hoy9i-00027F-Dc
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 18:48:42 -0400
Received: from list by blaine.gmane.org with local (Exim 4.89)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hoy9e-00023w-OT
 for bug-gnu-emacs@HIDDEN; Sun, 21 Jul 2019 00:48:38 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
Date: Sat, 20 Jul 2019 23:48:30 +0100
Message-ID: <86o91oxqyp.fsf@HIDDEN>
References: <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
 <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
 <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <86tvbgfs6g.fsf@HIDDEN>
 <CAOqdjBfgCeQx8bmyuJWGB7xjFrTuOrX-+JQhanmj-6eKXhg_vg@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)
Cancel-Lock: sha1:GKztxVTohg+R7EbSgmlF68VPtP8=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 195.159.176.226
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

On Sat 20 Jul 2019, Pip Cet wrote:

> On Sat, Jul 20, 2019 at 7:00 PM Andy Moreton <andrewjmoreton@HIDDEN> wrote:
>> > Patch attached. It'd be nice to have tests for this, of course, but
>> > it'd be easier for someone who understands CCL to do...
>>
>> Are the tests in test/lisp/international/ccl-tests.el sufficient ? If
>> not, please etend them to cover this case.
>
> I'm trying, but it seems like the CCL code is somewhat broken:
> `ccl-embed-symbol', as it is now, can never succeed, because it passes
> a cons cell rather than a fixnum to (ultimately) logand.

Agreed - probably my fault when fixing this code up to prepare for
bignum support.

>  (defun ccl-fixnum (code)
>    "Convert a CCL code word to a fixnum value."
> -  (- (logxor (logand code #x0fffffff) #x08000000) #x08000000))
> +  (if (integerp code)
> +      (- (logxor (logand code #x0fffffff) #x08000000) #x08000000)
> +    code))

`ccl-fixnum' should only receive integer arguments, so perhaps this fix
should go in the call in `ccl-embed-data' instead:

    (aset ccl-program-vector ccl-current-ic
      (if (numberp data) (ccl-fixnum data) data))

Thanks,

    AndyM





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 20 Jul 2019 20:19:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 16:19:05 2019
Received: from localhost ([127.0.0.1]:57932 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hovov-0003qm-EH
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 16:19:05 -0400
Received: from mail-oi1-f175.google.com ([209.85.167.175]:41907)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pipcet@HIDDEN>) id 1hovot-0003qE-Kd
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 16:19:04 -0400
Received: by mail-oi1-f175.google.com with SMTP id g7so26822384oia.8
 for <36740 <at> debbugs.gnu.org>; Sat, 20 Jul 2019 13:19:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=eqzkS0QmDCz6PdBdX3arRD1BS3HQuFE+2U86HyF0Pkg=;
 b=Hz9C54V/7km/V8LlYXugB/wIYpBqmfTAr1UH9yCXpn3H6WDCBlCn58S18aUobOZtj+
 bAKPcuT6SGmmQ4B53BignoyeItu39XUFFyV1Dw9F0EzM0Y7iKJbP9+DtXROkf9O1XDxf
 fnRtujNUqCW11RUm16V1m7iB5P/GTZzmoVxDdgRQtKAFS8HVpNx4SCx4OEQ1vgYPKYHj
 11PH7OwUaTWkMiyEX/7yH0uhqlHZ4A8G7iO2eRzYCnhLpG5xHCh4bJwuA50RGwISB/ai
 8HyF9VuDFNrWaD6jBP+N/a4kz2Linhqna2+sHEhNFQclPoCJzmCEB1l72PL7MLWp1OG/
 CFqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=eqzkS0QmDCz6PdBdX3arRD1BS3HQuFE+2U86HyF0Pkg=;
 b=i9iP7x3rrpVNQFJn0dvOQ2H1ILJlwnYBqSDZKjRwREtVXEBY97+2IFXg+4Nqy5NceZ
 aw185qkHX4pDvYSUvuv+pTdRlRi4nEIcHHpeftQdfkZr8xIiriGdSH9vlFkTVTfqVfwf
 4N6oZXz+3OiiPNOgwi0/anjecKgVQcTUkyZ3gdwYtKDCEu9mjyRiVnMe8688BXSOyOug
 NWsjLxFhZmUDGR+u0Cmqc+N+igVWExTCkonqdxoSruerx1IT6DieVmo0FsvH49I4WTMd
 UjAeJE7otIHsTNIpJfQkTY5/EW9VNfVcjfESxx1aQQx1oxyudw3oVXWF55d5PhGqRRXo
 06ng==
X-Gm-Message-State: APjAAAWKZdcxW9KaSN7MVUw309vELxgFwfQPAdYbnO1idz0JYzoXcami
 0dCKqTGo8eGacodsBMiLyti5rQ5TGN8OpmN8Mzc=
X-Google-Smtp-Source: APXvYqyu6J9H54QYYA465n1lc2q4YEOwMmN6bgokO52WxLmJDQdEoU0jyWgPivmhHNd8595ItoWQ/rk5mdFKKEZvjaA=
X-Received: by 2002:aca:aa93:: with SMTP id
 t141mr29440518oie.128.1563653937951; 
 Sat, 20 Jul 2019 13:18:57 -0700 (PDT)
MIME-Version: 1.0
References: <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
 <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
 <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <86tvbgfs6g.fsf@HIDDEN>
In-Reply-To: <86tvbgfs6g.fsf@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Date: Sat, 20 Jul 2019 20:18:21 +0000
Message-ID: <CAOqdjBfgCeQx8bmyuJWGB7xjFrTuOrX-+JQhanmj-6eKXhg_vg@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
To: Andy Moreton <andrewjmoreton@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000861fdd058e228da0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36740
Cc: 36740 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000861fdd058e228da0
Content-Type: text/plain; charset="UTF-8"

On Sat, Jul 20, 2019 at 7:00 PM Andy Moreton <andrewjmoreton@HIDDEN> wrote:
> > Patch attached. It'd be nice to have tests for this, of course, but
> > it'd be easier for someone who understands CCL to do...
>
> Are the tests in test/lisp/international/ccl-tests.el sufficient ? If
> not, please etend them to cover this case.

I'm trying, but it seems like the CCL code is somewhat broken:
`ccl-embed-symbol', as it is now, can never succeed, because it passes
a cons cell rather than a fixnum to (ultimately) logand.

The attached patch tries to fix that issue and adds a test. I've also
noticed I cannot use C-g to interrupt a CCL loop, is that intentional?

--000000000000861fdd058e228da0
Content-Type: text/x-patch; charset="US-ASCII"; 
	name="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Disposition: attachment; 
	filename="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_jybz3kvx0>
X-Attachment-Id: f_jybz3kvx0

RnJvbSBkYmFkOTZlMDdhYWE1MDM4MTk4MDQ3YTBkMmU0MTAyYzgyMGYwYjY5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaXAgQ2V0IDxwaXBjZXRAZ21haWwuY29tPgpEYXRlOiBTYXQs
IDIwIEp1bCAyMDE5IDE0OjQ3OjM5ICswMDAwClN1YmplY3Q6IFtQQVRDSF0gRml4IHJldHVybiB2
YWx1ZSBmb3IgQ0NMIG9wY29kZSBsb29rdXAtaW50ZWdlcgoKKiBzcmMvY2NsLmMgKGNjbF9kcml2
ZXIpOiBGaXggTG9va3VwSW50Q29uc3RUYmwgcmV0dXJuIHZhbHVlLgoqIHRlc3QvbGlzcC9pbnRl
cm5hdGlvbmFsL2NjbC10ZXN0cy5lbCAoY2NsLWhhc2gtdGFibGUpOiBBZGQgdG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S1jb2RlKQogICAgIChz
aG91bGQgKGVxdWFsIChidWZmZXItc3RyaW5nKSBwcm9nLW1pZGktZHVtcCkpKSkKKworKGVydC1k
ZWZ0ZXN0IGNjbC1oYXNoLXRhYmxlICgpCisgIChsZXQgKChzeW0gKGdlbnN5bSkpCisgICAgICAg
ICh0YWJsZSAobWFrZS1oYXNoLXRhYmxlIDp0ZXN0ICdlcSkpKQorICAgIChwdXRoYXNoIDE2IDE3
IHRhYmxlKQorICAgIChwdXRoYXNoIDE3IDE2IHRhYmxlKQorICAgIChkZWZpbmUtdHJhbnNsYXRp
b24taGFzaC10YWJsZSBzeW0gdGFibGUpCisgICAgKGxldCogKChwcm9nIGAoMgorICAgICAgICAg
ICAgICAgICAgICgobG9vcAorICAgICAgICAgICAgICAgICAgICAgKGxvb2t1cC1pbnRlZ2VyICxz
eW0gcjAgcjEpKSkpKQorICAgICAgICAgICAoY29tcGlsZWQgKGNjbC1jb21waWxlIHByb2cpKQor
ICAgICAgICAgICAocmVnaXN0ZXJzIFsxNyAwIDAgMCAwIDAgMCAwXSkpCisgICAgICAoY2NsLWV4
ZWN1dGUgY29tcGlsZWQgcmVnaXN0ZXJzKQorICAgICAgKHNob3VsZCAoZXF1YWwgcmVnaXN0ZXJz
IFsyIDE2IDAgMCAwIDAgMCAxXSkpKSkpCi0tIAoyLjIyLjAKCg==
--000000000000861fdd058e228da0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jul 2019 18:59:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 14:59:52 2019
Received: from localhost ([127.0.0.1]:57911 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1houaF-0001mi-Nq
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 14:59:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:47471)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1houaE-0001ma-Bz
 for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 14:59:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33460)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1houaD-0002yu-Ea
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 14:59:50 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 RDNS_DYNAMIC,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1houaC-0003Vc-IR
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 14:59:49 -0400
Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:40662
 helo=blaine.gmane.org)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1houaC-0003U6-Bd
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 14:59:48 -0400
Received: from list by blaine.gmane.org with local (Exim 4.89)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1houa9-000n5e-Lc
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 20:59:45 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
Date: Sat, 20 Jul 2019 19:59:35 +0100
Message-ID: <86tvbgfs6g.fsf@HIDDEN>
References: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
 <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)
Cancel-Lock: sha1:afoGFEhZIg5YdE/bn8GZOVLOGRQ=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 195.159.176.226
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

On Sat 20 Jul 2019, Pip Cet wrote:

> On Sat, Jul 20, 2019 at 1:51 PM Eli Zaretskii <eliz@HIDDEN> wrote:
>> So this was fixed at some point, but for some reason the fix didn't
>> make it into Emacs 23.
>>
>> So yes, I think we should use the value of XINT(opl) here.
>
> Patch attached. It'd be nice to have tests for this, of course, but
> it'd be easier for someone who understands CCL to do...

Are the tests in test/lisp/international/ccl-tests.el sufficient ? If
not, please etend them to cover this case.

    AndyM





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 20 Jul 2019 14:59:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 10:59:13 2019
Received: from localhost ([127.0.0.1]:57755 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hoqpM-0005kt-RR
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 10:59:13 -0400
Received: from mail-ot1-f43.google.com ([209.85.210.43]:41654)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pipcet@HIDDEN>) id 1hoqpL-0005kY-Cu
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 10:59:11 -0400
Received: by mail-ot1-f43.google.com with SMTP id o101so35780073ota.8
 for <36740 <at> debbugs.gnu.org>; Sat, 20 Jul 2019 07:59:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=IdQcWJYIb+6eKfvzp2Zq6ig1kogSw2vl9SWkfMir1z4=;
 b=EbUxNbL5dR1YhDSGyUA5f3DEPRHe7GaSOJrlCBanIkjQS8OWtpZ+wSf9wYusd/xZM4
 DTHItsERG5OAm9A8MTOhIAzT7xcdzw9tE8c5OZbFjV84WSsGkdsnuh1BeCeDfL79xGtT
 nuyFFq6p3ruXE1qUEblSHONup/q6uIZsF5IpNkJS05ZWGV3W9FX7mpICLhaUKlU4usAL
 zgogGKq8G1dzAuC79GgSbskyif/d6NdoOTKzvDV1r0suMEejP092iO7yYG0fAFCWP9OQ
 0AN10EMPSEp+bkCY14tI5wspdWXFhZPAhwUMUguE85t5clCk9PxcWfK7SgrTKjQefhg3
 mg6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=IdQcWJYIb+6eKfvzp2Zq6ig1kogSw2vl9SWkfMir1z4=;
 b=aOT9IWm8CM7hnpk5Rpgyx5orIlP0t26L/9ho9A8Jc1jqGy7J6sp9oeuRElXkpQnrD+
 LGao97P/PDJUwC9HB0h9G7SSbuU8JKnwLPKhLoknKgMtEGson2XEwKSQNP+uxNXsOHoJ
 MUrPS0v8d0cjrFW5NyHFCegJrdj9kumOyJChFToiaNSjB8r+EUoLmWcX2qSGf3Kuua2q
 zFZfgvVZhlxcbmeVaeht/ExuSHDEuoxkqApOsSMD5DiII251mai5uLOrW9GEzaERddSN
 APNkK9Vx8vfJOZi7oDgFIT/CJtI3zDthX3Qw5AXlgTYPZ5bm7dzQDouKkRyBCJyWfh2l
 VwmA==
X-Gm-Message-State: APjAAAUmAixxJ3yYYjhkTw2hVf3IIgGoxnE1gW7CHP/GBxreLUnklLmC
 zfEAXEJEenP0tMGduD2UEFamyU1x/A054bdzQdY=
X-Google-Smtp-Source: APXvYqxENUvXLGumBVldUSTGvvewhH96FY++SwwKlEZdjCNy/rQVxk7/ZfyJb6vll+IShLKd8CD8apW6PEgk599K8Js=
X-Received: by 2002:a9d:6014:: with SMTP id h20mr10517159otj.210.1563634745778; 
 Sat, 20 Jul 2019 07:59:05 -0700 (PDT)
MIME-Version: 1.0
References: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <838sssu9rr.fsf@HIDDEN> <834l3gu845.fsf@HIDDEN>
In-Reply-To: <834l3gu845.fsf@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Date: Sat, 20 Jul 2019 14:58:29 +0000
Message-ID: <CAOqdjBcK92zhrQmXwngUwQnsP7Q2+nLFnYL6C6avkZxjxav9Jg@HIDDEN>
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/mixed; boundary="00000000000094d22a058e1e1553"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36740
Cc: Kenichi Handa <handa@HIDDEN>, 36740 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000094d22a058e1e1553
Content-Type: text/plain; charset="UTF-8"

On Sat, Jul 20, 2019 at 1:51 PM Eli Zaretskii <eliz@HIDDEN> wrote:
> So this was fixed at some point, but for some reason the fix didn't
> make it into Emacs 23.
>
> So yes, I think we should use the value of XINT(opl) here.

Patch attached. It'd be nice to have tests for this, of course, but
it'd be easier for someone who understands CCL to do...

--00000000000094d22a058e1e1553
Content-Type: application/x-patch; 
	name="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Disposition: attachment; 
	filename="0001-Fix-return-value-for-CCL-opcode-lookup-integer.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_jybni1qi0>
X-Attachment-Id: f_jybni1qi0

RnJvbSAzMGFkZTZjMmM2NzE3ZTk5YzM1ZGQ3ZTBiOWRhNjg2NjAzOWI5YjUxIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaXAgQ2V0IDxwaXBjZXRAZ21haWwuY29tPgpEYXRlOiBTYXQs
IDIwIEp1bCAyMDE5IDE0OjQ3OjM5ICswMDAwClN1YmplY3Q6IFtQQVRDSF0gRml4IHJldHVybiB2
YWx1ZSBmb3IgQ0NMIG9wY29kZSBsb29rdXAtaW50ZWdlcgoKKiBzcmMvY2NsLmMgKGNjbF9kcml2
ZXIpOiBGaXggTG9va3VwSW50Q29uc3RUYmwgcmV0dXJuIHZhbHVlLgotLS0KIHNyYy9jY2wuYyB8
IDIgKy0KIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKSwgMSBkZWxldGlvbigtKQoKZGlm
ZiAtLWdpdCBhL3NyYy9jY2wuYyBiL3NyYy9jY2wuYwppbmRleCBmZjQyYzZmMjVmLi5kYTI1NTll
MGIxIDEwMDY0NAotLS0gYS9zcmMvY2NsLmMKKysrIGIvc3JjL2NjbC5jCkBAIC0xMjk5LDcgKzEy
OTksNyBAQCAjZGVmaW5lIEVYQ01EIChmaWVsZDEgPj4gNikKIAkJICAgIGlmICghIChJTl9JTlRf
UkFOR0UgKGVvcCkgJiYgQ0hBUkFDVEVSUCAob3BsKSkpCiAJCSAgICAgIENDTF9JTlZBTElEX0NN
RDsKIAkJICAgIHJlZ1tSUlJdID0gY2hhcnNldF91bmljb2RlOwotCQkgICAgcmVnW3Jycl0gPSBl
b3A7CisJCSAgICByZWdbcnJyXSA9IFhGSVhOVU0gKG9wbCk7CiAJCSAgICByZWdbN10gPSAxOyAv
KiByNyB0cnVlIGZvciBzdWNjZXNzICovCiAJCSAgfQogCQllbHNlCi0tIAoyLjIyLjAKCg==
--00000000000094d22a058e1e1553--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 20 Jul 2019 13:51:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 09:51:59 2019
Received: from localhost ([127.0.0.1]:56948 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hopmJ-0003ro-41
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:51:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37950)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hopmH-0003rP-7W
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:51:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51011)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hopmA-0005YM-FE; Sat, 20 Jul 2019 09:51:51 -0400
Received: from [176.228.60.248] (port=2653 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hopm9-0000CL-Hs; Sat, 20 Jul 2019 09:51:50 -0400
Date: Sat, 20 Jul 2019 16:51:38 +0300
Message-Id: <834l3gu845.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: pipcet@HIDDEN, Kenichi Handa <handa@HIDDEN>
In-reply-to: <838sssu9rr.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 20
 Jul 2019 16:15:52 +0300)
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
References: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <838sssu9rr.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36740
Cc: 36740 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 20 Jul 2019 16:15:52 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 36740 <at> debbugs.gnu.org
> 
> > From: Pip Cet <pipcet@HIDDEN>
> > Date: Sat, 20 Jul 2019 12:29:57 +0000
> > 
> > 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 comment for the op-code says:
> 
>   #define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by
> 					integer key.  Afterwards R7 set
> 					to 1 if lookup succeeded.
> 					1:ExtendedCOMMNDRrrRRRXXXXXXXX
> 					2:ARGUMENT(Hash table ID) */
> 
> so there appears to be no significance to r7's value?

Actually, I think you are right.  In Emacs 22.1 we had this:

	    case CCL_LookupIntConstTbl:
	      op = XINT (ccl_prog[ic]); /* table */
	      ic++;
	      {
		struct Lisp_Hash_Table *h = GET_HASH_TABLE (op);

		op = hash_lookup (h, make_number (reg[RRR]), NULL);
		if (op >= 0)
		  {
		    Lisp_Object opl;
		    opl = HASH_VALUE (h, op);
		    if (!CHAR_VALID_P (XINT (opl), 0))
		      CCL_INVALID_CMD;
		    SPLIT_CHAR (XINT (opl), reg[RRR], i, j);
		    if (j != -1)
		      i = (i << 7) | j;
		    reg[rrr] = i;
		    reg[7] = 1; /* r7 true for success */
		  }
		else
		  reg[7] = 0;
	      }

So this was fixed at some point, but for some reason the fix didn't
make it into Emacs 23.

So yes, I think we should use the value of XINT(opl) here.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 20 Jul 2019 13:23:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 09:23:34 2019
Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hopKo-00031i-9E
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:23:34 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33071)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hopKk-00030x-5X
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:23:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50624)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hopKf-0004X6-1U
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:23:25 -0400
Received: from [176.228.60.248] (port=4883 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1hopKe-00068h-ID
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:23:24 -0400
Date: Sat, 20 Jul 2019 16:23:15 +0300
Message-Id: <835znwu9fg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: 36740 <at> debbugs.gnu.org
In-reply-to: <838sssu9rr.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 20
 Jul 2019 16:15:52 +0300)
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
References: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 <838sssu9rr.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36740
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 20 Jul 2019 16:15:52 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 36740 <at> debbugs.gnu.org
> 
> I've CC'ed Handa-san, who might have some comments about this.

But the return email has no Kenichi Handa's address on the CC list.
What's going on? is debbugs removing addressees from the messages or
something? why?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at 36740 <at> debbugs.gnu.org:


Received: (at 36740) by debbugs.gnu.org; 20 Jul 2019 13:16:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 09:16:13 2019
Received: from localhost ([127.0.0.1]:56923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hopDg-0002pp-J5
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:16:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60160)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hopDd-0002pb-MT
 for 36740 <at> debbugs.gnu.org; Sat, 20 Jul 2019 09:16:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50532)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hopDY-0000Ro-Iu; Sat, 20 Jul 2019 09:16:04 -0400
Received: from [176.228.60.248] (port=4417 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hopDX-0005iX-IK; Sat, 20 Jul 2019 09:16:04 -0400
Date: Sat, 20 Jul 2019 16:15:52 +0300
Message-Id: <838sssu9rr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Pip Cet <pipcet@HIDDEN>
In-reply-to: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
 (message from Pip Cet on Sat, 20 Jul 2019 12:29:57 +0000)
Subject: Re: bug#36740: 27.0.50;
 apparently buggy code in ccl.c (lookup-integer-constant)
References: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36740
Cc: 36740 <at> debbugs.gnu.org, Kenichi Handa <handa@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Pip Cet <pipcet@HIDDEN>
> Date: Sat, 20 Jul 2019 12:29:57 +0000
> 
> 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 comment for the op-code says:

  #define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by
					integer key.  Afterwards R7 set
					to 1 if lookup succeeded.
					1:ExtendedCOMMNDRrrRRRXXXXXXXX
					2:ARGUMENT(Hash table ID) */

so there appears to be no significance to r7's value?

Why did you think this code was wrong?  And why is this important in
the context of your playing with hash tables?

> The bug appears to be present in:
> 
> commit d325055a00e658a38c1721fcc63ed1775dd8ccb3
> Author: Dave Love <fx@HIDDEN>
> 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 don't see ccl-compile-lookup-integer used anywhere, FWIW.
I've CC'ed Handa-san, who might have some comments about this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jul 2019 12:30:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 20 08:30:40 2019
Received: from localhost ([127.0.0.1]:56907 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hooVb-0001mP-Qp
	for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 08:30:40 -0400
Received: from lists.gnu.org ([209.51.188.17]:54322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pipcet@HIDDEN>) id 1hooVZ-0001mF-81
 for submit <at> debbugs.gnu.org; Sat, 20 Jul 2019 08:30:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33009)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <pipcet@HIDDEN>) id 1hooVY-0006BA-BW
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 08:30:37 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pipcet@HIDDEN>) id 1hooVX-0001vw-Hg
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 08:30:36 -0400
Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:41177)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <pipcet@HIDDEN>) id 1hooVX-0001up-CA
 for bug-gnu-emacs@HIDDEN; Sat, 20 Jul 2019 08:30:35 -0400
Received: by mail-ot1-x32c.google.com with SMTP id o101so35547963ota.8
 for <bug-gnu-emacs@HIDDEN>; Sat, 20 Jul 2019 05:30:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=ougrvqwPYWk3F9LbdMKGZvDy2KWdkpysnZxNRpZsGcc=;
 b=iqqkYjXt+M7zi3bZuwM3d6DuG+S7Ky5COlknk4d+OjHFT1AAR/XayEKIx6rlSpq7vw
 +Nak6YHVRLp6Eahng2ks4+1VQ5FSIsmsSkzSshbYoAKZ+MybiEyRnyZXDGESvg4HMUeK
 EZDf/ZJTGdQ6yaLBDCCk8tNxmf+yAMCg82tOIruv8e94SIXYa8VeVmbJUEr+dN+fNIJO
 M38EFs8+Mj7+FD+y2540EEYirODTYV4u1RYmKOGwoQ7rSummpSBq/c9UGjWRLgkK5U3C
 GYrAJxPuETOAC26n2uoqEr3pQQgMcKefWtToF0nbMzE0r0/Cbn+E8/iF3NlKCeQ8PutG
 YrGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=ougrvqwPYWk3F9LbdMKGZvDy2KWdkpysnZxNRpZsGcc=;
 b=jtlDqPWY+kHmke5VeXWGNrLDdQ4pV6X9N3hXX/OiU5EHrW1nV4jdCVPz4FwDUyOt0M
 YL6LNi+jLOnRmaulLYex2D0ZRJkRXXq/pDreTq/AFRzurYGIwXP5fDs6EExaMLa15JnA
 pnRtE2gR/prHHWMtdaXxXPhSa9ilmS1GsV7AUh4JvfyMi7iVyFXQqrLVeSYRx3pg51af
 hPb8ZqaZo9Ahjz+/GWKqwWEeSzYbGR7HkoJU9vU2cNA0u5fuBLVR0TUn5U5ILBFzuq7I
 1DRysFI71PeHJ63TjB2oVfblVdVvBaSc3sL+mQ45KO8Dqu7srFaRFZBTu/oPMC19weT9
 I9vQ==
X-Gm-Message-State: APjAAAXvQ0qyJvhcd2qFAH7cm81mpNPzANStLY2duYXC8gyLkmnIS+9u
 qo45QFUmLeTzcW5rSO84BzeidKoQ8uwYL+tVNBgVgxb9
X-Google-Smtp-Source: APXvYqw2tG8Fjlh0upZ2FmnbqMxCZPDJJE8/lKrzZy1BnRju0KE5oH7YADP5zwZz2DY8YNojmsR1sDLkjb+CAsit9vU=
X-Received: by 2002:a9d:6014:: with SMTP id h20mr10071920otj.210.1563625833942; 
 Sat, 20 Jul 2019 05:30:33 -0700 (PDT)
MIME-Version: 1.0
From: Pip Cet <pipcet@HIDDEN>
Date: Sat, 20 Jul 2019 12:29:57 +0000
Message-ID: <CAOqdjBcO0cfsk-2yTmyUeo1O1XAT4qB-fG=quvNSHxaeT6wKxQ@HIDDEN>
Subject: 27.0.50; apparently buggy code in ccl.c (lookup-integer-constant)
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::32c
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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@HIDDEN>
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.




Acknowledgement sent to Pip Cet <pipcet@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#36740; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 1 Aug 2019 17:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.