diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-03-04 18:55:54 -0500 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-03-05 19:12:14 +0000 |
commit | 2779dcf1a3ceec167d36a36fc44de44737edcc4c (patch) | |
tree | e91883f4c1fd963dbccd4a752591b8144c57bf1c /regcomp.c | |
parent | 4dab3d39561362222a38b2524aa7c6adfc2626de (diff) | |
download | perl-2779dcf1a3ceec167d36a36fc44de44737edcc4c.tar.gz |
[5.004_61 PATCH] Make incompatible changes to RE engine NOW
p4raw-id: //depot/perl@785
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -812,6 +812,11 @@ pregcomp(char *exp, char *xend, PMOP *pm) r->regstclass = NULL; r->naughty = regnaughty >= 10; /* Probably an expensive pattern. */ scan = r->program + 1; /* First BRANCH. */ + + /* XXXX To minimize changes to RE engine we always allocate + 3-units-long substrs field. */ + Newz(1004, r->substrs, 1, struct reg_substr_data); + if (OP(scan) != BRANCH) { /* Only one top-level choice. */ scan_data_t data; I32 fake; @@ -906,7 +911,7 @@ pregcomp(char *exp, char *xend, PMOP *pm) r->float_substr = data.longest_float; r->float_min_offset = data.offset_float_min; r->float_max_offset = data.offset_float_max; - fbm_compile(r->float_substr); + fbm_compile(r->float_substr, 0); BmUSEFUL(r->float_substr) = 100; if (data.flags & SF_FL_BEFORE_EOL /* Cannot have SEOL and MULTI */ && (!(data.flags & SF_FL_BEFORE_MEOL) @@ -926,7 +931,7 @@ pregcomp(char *exp, char *xend, PMOP *pm) || (regflags & PMf_MULTILINE)))) { r->anchored_substr = data.longest_fixed; r->anchored_offset = data.offset_fixed; - fbm_compile(r->anchored_substr); + fbm_compile(r->anchored_substr, 0); BmUSEFUL(r->anchored_substr) = 100; if (data.flags & SF_FIX_BEFORE_EOL /* Cannot have SEOL and MULTI */ && (!(data.flags & SF_FIX_BEFORE_MEOL) @@ -2565,6 +2570,8 @@ pregfree(struct regexp *r) Safefree(r->precomp); if (r->subbase) Safefree(r->subbase); + if (r->substrs) + Safefree(r->substrs); if (r->anchored_substr) SvREFCNT_dec(r->anchored_substr); if (r->float_substr) |