diff options
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -86,10 +86,12 @@ PP(pp_regcomp) { else { t = SvPV(tmpstr, len); - /* JMR: Check against the last compiled regexp */ - if ( ! pm->op_pmregexp || ! pm->op_pmregexp->precomp - || strnNE(pm->op_pmregexp->precomp, t, len) - || pm->op_pmregexp->precomp[len]) { + /* JMR: Check against the last compiled regexp + To know for sure, we'd need the length of precomp. + But we don't have it, so we must ... take a guess. */ + if (!pm->op_pmregexp || !pm->op_pmregexp->precomp || + memNE(pm->op_pmregexp->precomp, t, len + 1)) + { if (pm->op_pmregexp) { ReREFCNT_dec(pm->op_pmregexp); pm->op_pmregexp = Null(REGEXP*); /* crucial if regcomp aborts */ |