Re: [PATCH v4 05/19] grep: remove redundant `regflags &= ~REG_EXTENDED` assignments
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2017, 05:29 UTC
- Message-ID
- <xmqqvaprrb37.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170425210548.24612-6-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 8 quoted lines
> @@ -417,7 +415,6 @@ static void compile_fixed_regexp(struct grep_pat *p, struct grep_opt *opt) > int regflags; > > basic_regex_quote_buf(&sb, p->pattern); > - regflags = opt->regflags & ~REG_EXTENDED; > if (opt->ignore_case) > regflags |= REG_ICASE; > err = regcomp(&p->regexp, sb.buf, regflags);
This hunk is wrong. Now the use of regflags we see in the post context is mixing ICASE bit into an uninitialized garbage on the stack.