aboutsummaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-09-23 15:24:08 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-09-23 15:24:08 -0700
commitfac3fd97721958c8570869d24dd112fc6cbc468e (patch)
treeec00770c187f26923dc3d6aaf145ca9876754774 /match.c
parent8e1e6572feabd291cbd5048459c0a58c6460ff91 (diff)
Moving pattern lifetime tracking off of files and onto its own list of
allocated pats.
Diffstat (limited to 'match.c')
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.c b/match.c
index 9e8e388..c4faeb7 100644
--- a/match.c
+++ b/match.c
@@ -517,7 +517,7 @@ static match_t *match(def_t *defs, cache_t *cache, file_t *f, const char *str, p
if (m1->pat->type == BP_CAPTURE && m1->pat->args.capture.name) {
// Temporarily add a rule that the backref name matches the
// exact string of the original match (no replacements)
- pat_t *backref = bp_raw_literal(f, m1->start, (size_t)(m1->end - m1->start));
+ pat_t *backref = bp_raw_literal(m1->start, (size_t)(m1->end - m1->start));
def_t *defs2 = with_def(defs, m1->pat->args.capture.namelen, m1->pat->args.capture.name, backref);
++m1->refcount; {
m2 = match(defs2, cache, f, m1->end, pat->args.multiple.second, ignorecase);