diff options
author | Yves Orton <demerphq@gmail.com> | 2012-04-16 21:41:43 +0200 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2012-04-19 10:19:50 +1000 |
commit | 6af40bd7eed11bbc14c315986f938ecb5094be0b (patch) | |
tree | 73f112aec14e91fb3799d36a4b0585a1d6ba5f24 /regexec.c | |
parent | 1a15d16d8ab308fc4f99063c180391a513f81fdb (diff) | |
download | perl-6af40bd7eed11bbc14c315986f938ecb5094be0b.tar.gz |
remove assert and change message
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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; } |