From: K.Kosako Date: Fri, 20 Sep 2019 07:17:14 +0000 (+0900) Subject: fix: all match-arg should be initialized before matching X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83ba053863e19ce917e060da6f11285948dfc1b5;p=onig fix: all match-arg should be initialized before matching --- diff --git a/src/regexec.c b/src/regexec.c index 0d4d4a9..0dedb33 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -4468,6 +4468,9 @@ onig_regset_search_with_param(OnigRegSet* set, for (i = 0; i < set->n; i++) { reg = set->rs[i].reg; MATCH_ARG_INIT(msas[i], reg, option, set->rs[i].region, start, mps[i]); + } + for (i = 0; i < set->n; i++) { + reg = set->rs[i].reg; if (reg->threshold_len == 0) { REGSET_MATCH_AND_RETURN_CHECK(end); }