aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-12-13 02:52:23 +0000
committerKarl Heuer1995-12-13 02:52:23 +0000
commit9121ca4020057e02487e37ce5c8355d9ba3e781e (patch)
treea7d8b8185a72e2952f2cbd570e7b64686d26b299 /src
parent813f79d532f7fb4a1b9657649e884614460a606c (diff)
downloademacs-9121ca4020057e02487e37ce5c8355d9ba3e781e.tar.gz
emacs-9121ca4020057e02487e37ce5c8355d9ba3e781e.zip
(AT_WORD_BOUNDARY): Disable macro.
(re_match_2_internal): Work around compiler bug.
Diffstat (limited to 'src')
-rw-r--r--src/regex.c53
1 files changed, 46 insertions, 7 deletions
diff --git a/src/regex.c b/src/regex.c
index b4c124ae889..508a2714250 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3444,12 +3444,14 @@ static boolean alt_match_null_string_p (),
3444 : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ 3444 : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
3445 == Sword) 3445 == Sword)
3446 3446
3447/* Disabled due to a compiler bug -- see comment at case wordbound */
3448#if 0
3447/* Test if the character before D and the one at D differ with respect 3449/* Test if the character before D and the one at D differ with respect
3448 to being word-constituent. */ 3450 to being word-constituent. */
3449#define AT_WORD_BOUNDARY(d) \ 3451#define AT_WORD_BOUNDARY(d) \
3450 (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ 3452 (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
3451 || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) 3453 || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
3452 3454#endif
3453 3455
3454/* Free everything we malloc. */ 3456/* Free everything we malloc. */
3455#ifdef MATCH_MAY_ALLOCATE 3457#ifdef MATCH_MAY_ALLOCATE
@@ -4673,17 +4675,54 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
4673 break; 4675 break;
4674 } 4676 }
4675 4677
4676 case wordbound: 4678#if 0
4677 DEBUG_PRINT1 ("EXECUTING wordbound.\n"); 4679 /* The DEC Alpha C compiler 3.x generates incorrect code for the
4678 if (AT_WORD_BOUNDARY (d)) 4680 test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of
4681 AT_WORD_BOUNDARY, so this code is disabled. Expanding the
4682 macro and introducing temporary variables works around the bug. */
4683
4684 case wordbound:
4685 DEBUG_PRINT1 ("EXECUTING wordbound.\n");
4686 if (AT_WORD_BOUNDARY (d))
4679 break; 4687 break;
4680 goto fail; 4688 goto fail;
4681 4689
4682 case notwordbound: 4690 case notwordbound:
4683 DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); 4691 DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
4684 if (AT_WORD_BOUNDARY (d)) 4692 if (AT_WORD_BOUNDARY (d))
4685 goto fail; 4693 goto fail;
4686 break; 4694 break;
4695#else
4696 case wordbound:
4697 {
4698 boolean prevchar, thischar;
4699
4700 DEBUG_PRINT1 ("EXECUTING wordbound.\n");
4701 if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
4702 break;
4703
4704 prevchar = WORDCHAR_P (d - 1);
4705 thischar = WORDCHAR_P (d);
4706 if (prevchar != thischar)
4707 break;
4708 goto fail;
4709 }
4710
4711 case notwordbound:
4712 {
4713 boolean prevchar, thischar;
4714
4715 DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
4716 if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
4717 goto fail;
4718
4719 prevchar = WORDCHAR_P (d - 1);
4720 thischar = WORDCHAR_P (d);
4721 if (prevchar != thischar)
4722 goto fail;
4723 break;
4724 }
4725#endif
4687 4726
4688 case wordbeg: 4727 case wordbeg:
4689 DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); 4728 DEBUG_PRINT1 ("EXECUTING wordbeg.\n");