GNU bug report logs - #8751
24.0.50; CCL is broken

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Sat, 28 May 2011 12:51:02 UTC

Severity: normal

Found in version 24.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kenichi Handa <handa <at> m17n.org>
To: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Cc: eggert <at> cs.ucla.edu, monnier <at> iro.umontreal.ca, 8751 <at> debbugs.gnu.org
Subject: bug#8751: 24.0.50; CCL is broken
Date: Tue, 31 May 2011 14:12:54 +0900
Sorry for the late response on this matter.

In article <20110530232630.273942C803A <at> msa105.auone-net.jp>, Kazuhiro Ito <kzhr <at> d1.dion.ne.jp> 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 <at> m17n.org




This bug report was last modified 13 years and 359 days ago.

Previous Next


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