mirror of
https://github.com/fluencelabs/musl
synced 2025-06-27 21:52:02 +00:00
suppress backref processing in ERE regcomp
one of the features of ERE is that it's actually a regular language and does not admit expressions which cannot be matched in linear time. introduction of \n backref support into regcomp's ERE parsing was unintentional.
This commit is contained in:
@ -839,7 +839,7 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s)
|
|||||||
s--;
|
s--;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (isdigit(*s)) {
|
if (!ere && isdigit(*s)) {
|
||||||
/* back reference */
|
/* back reference */
|
||||||
int val = *s - '0';
|
int val = *s - '0';
|
||||||
node = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position);
|
node = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position);
|
||||||
|
Reference in New Issue
Block a user