From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#8751: 24.0.50; CCL is broken Date: Tue, 31 May 2011 14:12:54 +0900 Message-ID: References: <20110528124948.470A6360038@msa102.auone-net.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306818851 14477 80.91.229.12 (31 May 2011 05:14:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 May 2011 05:14:11 +0000 (UTC) Cc: eggert@cs.ucla.edu, 8751@debbugs.gnu.org To: Kazuhiro Ito Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 07:14:07 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QRHHL-0003pV-6q for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 07:14:07 +0200 Original-Received: from localhost ([::1]:45483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRHHK-0003EA-OR for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 01:14:06 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRHHI-0003Dw-05 for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 01:14:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRHHG-00014e-JR for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 01:14:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRHHG-00014a-Gh for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 01:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QRHHG-0003nF-2k; Tue, 31 May 2011 01:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2011 05:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8751 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8751-submit@debbugs.gnu.org id=B8751.130681880114526 (code B ref 8751); Tue, 31 May 2011 05:14:02 +0000 Original-Received: (at 8751) by debbugs.gnu.org; 31 May 2011 05:13:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRHGZ-0003mF-UJ for submit@debbugs.gnu.org; Tue, 31 May 2011 01:13:20 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRHGW-0003lw-O4 for 8751@debbugs.gnu.org; Tue, 31 May 2011 01:13:18 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id p4V5CtI7016729; Tue, 31 May 2011 14:12:56 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id p4V5CtWY009461; Tue, 31 May 2011 14:12:55 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id p4V5CsLN021003; Tue, 31 May 2011 14:12:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1QRHGA-0000s1-Gs; Tue, 31 May 2011 14:12:54 +0900 In-Reply-To: <20110530232630.273942C803A@msa105.auone-net.jp> (message from Kazuhiro Ito on Tue, 31 May 2011 08:26:24 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 31 May 2011 01:14:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46836 Archived-At: Sorry for the late response on this matter. In article <20110530232630.273942C803A@msa105.auone-net.jp>, Kazuhiro Ito writes: > > > The problem may be that ccl-compiler produce negative integer as CCL > > > code (at latest, since Emacs21). > > > > The negative number is normal (it's due to the relative instruction > > address for the backward jump at the end of the loop). The problem must > > be in the ccl.c code. > If that is right (and I think so, too), the comment of ccl.c should be > fixed. > > /* CCL code is a sequence of 28-bit non-negative integers (i.e. the Yes, this comment is wrong. It seems that I have forgotten to update it when I changed CCL to accept negative integer. > Here is a quick fix for actual code, but I don't check whether there > is other problems. > === modified file 'src/ccl.c' > --- src/ccl.c 2011-05-27 21:24:11 +0000 > +++ src/ccl.c 2011-05-30 22:19:52 +0000 > @@ -100,6 +100,7 @@ > CCL commands. */ > #define CCL_CODE_MAX ((1 << (28 - 1)) - 1) > +#define CCL_CODE_MIN (- CCL_CODE_MAX - 1) > /* CCL commands > @@ -756,7 +757,7 @@ > while (0) > #define GET_CCL_CODE(code, ccl_prog, ic) \ > - GET_CCL_RANGE (code, ccl_prog, ic, 0, CCL_CODE_MAX) > + GET_CCL_RANGE (code, ccl_prog, ic, CCL_CODE_MIN, CCL_CODE_MAX) > #define GET_CCL_INT(var, ccl_prog, ic) \ > GET_CCL_RANGE (var, ccl_prog, ic, INT_MIN, INT_MAX) Sorry but I still don't have a time to check the recent change. If the above patch fixes the code to match with the following revised comment, it is the right patch. /* CCL code is a sequence of 28-bit integers, each contains CCL command and/or arguments in the following format: |----------------- integer (28-bit) ------------------| |------- 17-bit ------|- 3-bit --|- 3-bit --|- 5-bit -| |--constant argument--|-register-|-register-|-command-| ccccccccccccccccc RRR rrr XXXXX or |------- relative address -------|-register-|-command-| cccccccccccccccccccc rrr XXXXX or |------------- constant or other args ----------------| cccccccccccccccccccccccccccc where, `cc...c' is a 17-bit, 20-bit, or 28-bit integer indicating a constant value or a relative/absolute jump address, `RRR' and `rrr' are CCL register number, `XXXXX' is one of the following CCL command codes. */ --- Kenichi Handa handa@m17n.org