diff options
| author | Stefan Monnier | 2023-09-27 13:29:50 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-09-27 13:29:50 -0400 |
| commit | bc52fdd1d153b36a9da74d7aa7f1e6150ff6b2eb (patch) | |
| tree | a302e300d15378c840b9eab4f49861c375dd52f7 /test/src | |
| parent | 9a67540e51edca00b17de639af18989f9ecc9be9 (diff) | |
| download | emacs-bc52fdd1d153b36a9da74d7aa7f1e6150ff6b2eb.tar.gz emacs-bc52fdd1d153b36a9da74d7aa7f1e6150ff6b2eb.zip | |
* src/regex-emacs.c (analyze_first): Fix incorrect optimization
The optimization was incorrect in a particular corner case.
In this fix I just disable it conservatively for more cases because
it's not obvious how to fix it while preserving the "good" cases.
We may find a better fix by using an approach like the one
in `mutually_exhaustive_aux`, but for now this is good enough,
especially since \{..\} repetitions are not used very frequently.
* test/src/regex-resources/PTESTS: New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/regex-resources/PTESTS | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/src/regex-resources/PTESTS b/test/src/regex-resources/PTESTS index 68acc314d37..59dd4b3bc21 100644 --- a/test/src/regex-resources/PTESTS +++ b/test/src/regex-resources/PTESTS | |||
| @@ -269,6 +269,7 @@ | |||
| 269 | #W the expected result for \([a-c]*\)\{2,\} is failure which isn't correct | 269 | #W the expected result for \([a-c]*\)\{2,\} is failure which isn't correct |
| 270 | 1¦3¦\([a-c]*\)\{2,\}¦abcdefg¦ | 270 | 1¦3¦\([a-c]*\)\{2,\}¦abcdefg¦ |
| 271 | 1¦3¦\([a-c]*\)\{1,\}¦abcdefg¦ | 271 | 1¦3¦\([a-c]*\)\{1,\}¦abcdefg¦ |
| 272 | 0¦0¦\([a-c]*\)\{2,\}¦gabcdefg¦ | ||
| 272 | -1¦-1¦a\{64,\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦ | 273 | -1¦-1¦a\{64,\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦ |
| 273 | # GA142 | 274 | # GA142 |
| 274 | 1¦3¦a\{2,3\}¦aaaa¦ | 275 | 1¦3¦a\{2,3\}¦aaaa¦ |