Always init NFAContext::cached_br

Now that it's on stack, this should be initialised. Silences a warning
from valgrind.
This commit is contained in:
Justin Viiret 2016-02-29 17:06:31 +11:00 committed by Matthew Barr
parent 90ea5b6010
commit ec223e3622

View File

@ -537,6 +537,7 @@ char JOIN(LIMEX_API_ROOT, _Q)(const struct NFA *n, struct mq *q, s64a end) {
ctx.callback = q->cb;
ctx.context = q->context;
STORE_STATE(&ctx.cached_estate, ZERO_STATE);
ctx.cached_br = 0;
assert(q->items[q->cur].location >= 0);
DEBUG_PRINTF("LOAD STATE\n");
@ -631,6 +632,7 @@ char JOIN(LIMEX_API_ROOT, _Q2)(const struct NFA *n, struct mq *q, s64a end) {
ctx.callback = q->cb;
ctx.context = q->context;
STORE_STATE(&ctx.cached_estate, ZERO_STATE);
ctx.cached_br = 0;
DEBUG_PRINTF("LOAD STATE\n");
STORE_STATE(&ctx.s, LOAD_STATE(q->state));
@ -722,6 +724,7 @@ char JOIN(LIMEX_API_ROOT, _QR)(const struct NFA *n, struct mq *q,
ctx.callback = NULL;
ctx.context = NULL;
STORE_STATE(&ctx.cached_estate, ZERO_STATE);
ctx.cached_br = 0;
DEBUG_PRINTF("LOAD STATE\n");
STORE_STATE(&ctx.s, LOAD_STATE(q->state));
@ -821,6 +824,7 @@ char JOIN(LIMEX_API_ROOT, _B_Reverse)(const struct NFA *n, u64a offset,
ctx.callback = cb;
ctx.context = context;
STORE_STATE(&ctx.cached_estate, ZERO_STATE);
ctx.cached_br = 0;
const IMPL_NFA_T *limex = getImplNfa(n);
STORE_STATE(&ctx.s, INITIAL_FN(limex, 0)); // always anchored