APPROVE COMMIT 21.4
Why is there a dimension on the declaration in syntax.h at all?
Thanks for the patch.
- Vin
On Fri, Dec 23, 2011 at 7:52 AM, Stephen J. Turnbull <stephen(a)xemacs.org> wrote:
Vin Shelton writes:
> > On Mon, Aug 8, 2011 at 2:40 AM, Stephen J. Turnbull wrote:
> >
> > Will do. Are you in a hurry (for values of "hurry" == "I'd
really
> > like this before Christmas")?
> >
>
> No, but the sooner I get it, the more likely I am to have time to
> process it. My year-end shutdown starts 12/23 and I'd love to turn
> out a release before I have to go back to work on Jan 3, but it's no
> big deal if I can't.
OK, so here's a (small) Christmas present for you.
This patch contains a fix for a real defect that I found when working
on Alan's bug. (It's a possible access to uninitialized data, though
I don't know of any bugs reported for it.)
However, Alan's patch is not applicable to 21.4, and I'm not even sure
how to port the tests (trying to figure out what the cache should
contain in a program by observing interactive behavior is a
nonstarter, because switching to a different buffer -- eg the
minibuffer -- will change the cache because it's global). I did check
that the particular recipe Alan reported is handled correctly by 21.4.
My other changes are either inapplicable (the related cache members
were added in 21.5) or I don't understand well enough. So none of
that stuff is in here.
# HG changeset patch
# Parent d66da3009d24b214b5038c4b1e028f0df1ab7e3a
Fix incorrect size of syntax_spec_code array.
diff -r d66da3009d24 src/ChangeLog
--- a/src/ChangeLog Sun Dec 11 16:48:01 2011 -0500
+++ b/src/ChangeLog Fri Dec 23 18:59:42 2011 +0900
@@ -1,3 +1,14 @@
+2011-08-05 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ There are only (octal) 0200 ASCII characters, and only 128 values
+ supplied in the definition.
+
+ * syntax.h (syntax_spec_code):
+ * syntax.c (syntax_spec_code):
+ Declare array with correct dimension.
+ * search.c (skip_chars):
+ Correct bounds check on index of syntax_spec_code.
+
2011-12-11 Julian Bradfield <jcb+xeb(a)jcbradfield.org>
* regex.c: ^ was wrongly interpreted as literal when occurring at
diff -r d66da3009d24 src/search.c
--- a/src/search.c Sun Dec 11 16:48:01 2011 -0500
+++ b/src/search.c Fri Dec 23 18:59:42 2011 +0900
@@ -826,7 +826,7 @@
INC_CHARPTR (p);
if (syntaxp)
{
- if (c < 0400 && syntax_spec_code[c] < (unsigned char) Smax)
+ if (c < 0200 && syntax_spec_code[c] < (unsigned char) Smax)
fastmap[c] = 1;
else
signal_simple_error ("Invalid syntax designator",
diff -r d66da3009d24 src/syntax.c
--- a/src/syntax.c Sun Dec 11 16:48:01 2011 -0500
+++ b/src/syntax.c Fri Dec 23 18:59:42 2011 +0900
@@ -498,7 +498,7 @@
into the code it signifies.
This is used by modify-syntax-entry, and other things. */
-const unsigned char syntax_spec_code[0400] =
+const unsigned char syntax_spec_code[0200] =
{ 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
diff -r d66da3009d24 src/syntax.h
--- a/src/syntax.h Sun Dec 11 16:48:01 2011 -0500
+++ b/src/syntax.h Fri Dec 23 18:59:42 2011 +0900
@@ -265,7 +265,7 @@
that character signifies (as a char).
For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */
-extern const unsigned char syntax_spec_code[0400];
+extern const unsigned char syntax_spec_code[0200];
/* Indexed by syntax code, give the letter that describes it. */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org