# HG changeset patch # User Stephen J. Turnbull # Date 1312779440 -32400 # Node ID dab422055babeac5fbbc739b44d6264085aaf62b # Parent ebd367b82ccd8af6849ea3437c2db3dc978637ae Correct array bound for syntax_code_spec. diff -r ebd367b82ccd -r dab422055bab src/ChangeLog --- a/src/ChangeLog Mon Aug 08 13:57:19 2011 +0900 +++ b/src/ChangeLog Mon Aug 08 13:57:20 2011 +0900 @@ -1,3 +1,14 @@ +2011-08-05 Stephen J. Turnbull + + 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-08-04 Stephen J. Turnbull * search.c (byte_scan_buffer): diff -r ebd367b82ccd -r dab422055bab src/search.c --- a/src/search.c Mon Aug 08 13:57:19 2011 +0900 +++ b/src/search.c Mon Aug 08 13:57:20 2011 +0900 @@ -926,7 +926,7 @@ INC_IBYTEPTR (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 invalid_argument ("Invalid syntax designator", make_char (c)); diff -r ebd367b82ccd -r dab422055bab src/syntax.c --- a/src/syntax.c Mon Aug 08 13:57:19 2011 +0900 +++ b/src/syntax.c Mon Aug 08 13:57:20 2011 +0900 @@ -600,7 +600,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 ebd367b82ccd -r dab422055bab src/syntax.h --- a/src/syntax.h Mon Aug 08 13:57:19 2011 +0900 +++ b/src/syntax.h Mon Aug 08 13:57:20 2011 +0900 @@ -262,7 +262,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. */