This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Add assertion
authorKarl Williamson <khw@cpan.org>
Wed, 13 Mar 2019 21:20:50 +0000 (15:20 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 13 Mar 2019 21:42:49 +0000 (15:42 -0600)
regexec.c

index e50145d..93d9afa 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -155,7 +155,7 @@ static const char* const non_utf8_target_but_utf8_required
 #define NEXTCHR_EOS -10 /* nextchr has fallen off the end */
 #define NEXTCHR_IS_EOS (nextchr < 0)
 
-#define SET_nextchr \
+#define SET_nextchr __ASSERT_(locinput <= reginfo->strend)                     \
     nextchr = ((locinput < reginfo->strend) ? UCHARAT(locinput) : NEXTCHR_EOS)
 
 #define SET_locinput(p) \