summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-02-24 14:42:09 +0100
committerJean Boussier <[email protected]>2025-02-24 18:32:46 +0100
commit97e6ad49a4604e7e4ca04da2aaafc63cbd5d29d8 ()
tree3bd9dd77fbf8e1865ccfc3435e2d30c7573e81f0 /re.c
parent87f9c3c65e38fa3e5c6ef097e2cf63ff448f48d6 (diff)
Reuse the backref if it isn't marked as busy.
[Misc #20652]
-rw-r--r--re.c15
1 files changed, 12 insertions, 3 deletions
@@ -1813,11 +1813,20 @@ rb_reg_search_set_match(VALUE re, VALUE str, long pos, int reverse, int set_back
return ONIG_MISMATCH;
}
- VALUE match;
- if (set_match && RTEST(*set_match)) {
match = *set_match;
}
- else {
match = match_alloc(rb_cMatch);
}