In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/6af40bd7eed11bbc14c315986f938ecb5094be0b?hp=1a15d16d8ab308fc4f99063c180391a513f81fdb>
- Log ----------------------------------------------------------------- commit 6af40bd7eed11bbc14c315986f938ecb5094be0b Author: Yves Orton <[email protected]> Date: Mon Apr 16 21:41:43 2012 +0200 remove assert and change message ----------------------------------------------------------------------- Summary of changes: regexec.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/regexec.c b/regexec.c index ea4810d..c22954a 100644 --- a/regexec.c +++ b/regexec.c @@ -2429,7 +2429,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, register char *stre dontbother = 0; if (prog->float_substr != NULL || prog->float_utf8 != NULL) { /* Trim the end. */ - char *last; + char *last= NULL; SV* float_real; if (!(utf8_target ? prog->float_utf8 : prog->float_substr)) @@ -2502,13 +2502,17 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, register char *stre last = strend; /* matching "$" */ } } - assert(last != NULL); /* the re_debug output below suggests we need this assert() */ - if (last == NULL) { + if (!last) { + /* at one point this block contained a comment which was probably + * incorrect, which said that this was a "should not happen" case. + * Even if it was true when it was written I am pretty sure it is + * not anymore, so I have removed the comment and replaced it with + * this one. Yves */ DEBUG_EXECUTE_r( PerlIO_printf(Perl_debug_log, - "%sCan't trim the tail, match fails (should not happen)%s\n", - PL_colors[4], PL_colors[5])); - goto phooey; /* Should not happen! */ + "String does not contain required substring, cannot match.\n" + )); + goto phooey; } dontbother = strend - last + prog->float_min_offset; } -- Perl5 Master Repository
