Revision: 901
http://www.exim.org/viewvc/pcre2?view=rev&revision=901
Author: ph10
Date: 2018-01-01 15:05:27 +0000 (Mon, 01 Jan 2018)
Log Message:
-----------
Small tidy to start of match optimizations.
Modified Paths:
--------------
code/trunk/src/pcre2_dfa_match.c
code/trunk/src/pcre2_match.c
Modified: code/trunk/src/pcre2_dfa_match.c
===================================================================
--- code/trunk/src/pcre2_dfa_match.c 2018-01-01 14:54:06 UTC (rev 900)
+++ code/trunk/src/pcre2_dfa_match.c 2018-01-01 15:05:27 UTC (rev 901)
@@ -3522,6 +3522,12 @@
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
start_match++;
}
+
+ /* See comment above in first_cu checking about the next line. */
+
+ if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0 &&
+ start_match >= mb->end_subject)
+ break;
}
} /* End of first code unit handling */
Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c 2018-01-01 14:54:06 UTC (rev 900)
+++ code/trunk/src/pcre2_match.c 2018-01-01 15:05:27 UTC (rev 901)
@@ -6526,6 +6526,14 @@
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
start_match++;
}
+
+ /* See comment above in first_cu checking about the next few lines. */
+
+ if (!mb->partial && start_match >= mb->end_subject)
+ {
+ rc = MATCH_NOMATCH;
+ break;
+ }
}
} /* End first code unit handling */