state->ptr = ctx->ptr;
- ctx->count = SRE_COUNT(state, ctx->pattern+3, ctx->pattern[2]);
- RETURN_ON_ERROR(ctx->count);
-
+ ret = SRE_COUNT(state, ctx->pattern+3, ctx->pattern[2]);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
+ ctx->count = ret;
ctx->ptr += ctx->count;
/* when we arrive here, count contains the number of
ctx->count = 0;
else {
/* count using pattern min as the maximum */
- ctx->count = SRE_COUNT(state, ctx->pattern+3,
- ctx->pattern[1]);
- RETURN_ON_ERROR(ctx->count);
- if (ctx->count < (int) ctx->pattern[1])
+ ret = SRE_COUNT(state, ctx->pattern+3, ctx->pattern[1]);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
+ if (ret < (int) ctx->pattern[1])
/* didn't match minimum number of times */
RETURN_FAILURE;
/* advance past minimum matches of repeat */
+ ctx->count = ret;
ctx->ptr += ctx->count;
}
state->ptr = ctx->ptr;
ret = SRE_COUNT(state, ctx->pattern+3, 1);
RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE_MATCH_CONTEXT, ctx, ctx_pos);
if (ret == 0)
break;
assert(ret == 1);