str_idx, dfa->nexts[node], to_idx))
str_idx, dst_node, to_idx))
sift_states_bkref (preg, mctx, sctx, str_idx, dest_nodes)     const regex_t *preg;     re_match_context_t *mctx;     re_sift_context_t *sctx;     int str_idx;     re_node_set *dest_nodes;{  reg_errcode_t err;  re_dfa_t *dfa = (re_dfa_t *)preg->buffer;  int node_idx, node;  re_sift_context_t local_sctx;  const re_node_set *candidates;  candidates = ((mctx->state_log[str_idx] == NULL) ? &empty_set                : &mctx->state_log[str_idx]->nodes);  local_sctx.sifted_states = NULL; /* Mark that it hasn't been initialized.  */  for (node_idx = 0; node_idx < candidates->nelem; ++node_idx)    {      int cur_bkref_idx = re_string_cur_idx (mctx->input);      re_token_type_t type;      node = candidates->elems[node_idx];      type = dfa->nodes[node].type;      if (node == sctx->cur_bkref && str_idx == cur_bkref_idx)        continue;      /* Avoid infinite loop for the REs like "()\1+".  */      if (node == sctx->last_node && str_idx == sctx->last_str_idx)        continue;      if (type == OP_BACK_REF)        {          int enabled_idx;          for (enabled_idx = 0; enabled_idx < mctx->nbkref_ents; ++enabled_idx)            {              int disabled_idx, subexp_len, to_idx, dst_node;              struct re_backref_cache_entry *entry;              entry = mctx->bkref_ents + enabled_idx;              subexp_len = entry->subexp_to - entry->subexp_from;              to_idx = str_idx + subexp_len;              dst_node = (subexp_len ? dfa->nexts[node]                          : dfa->edests[node].elems[0]);              if (entry->node != node || entry->str_idx != str_idx                  || to_idx > sctx->last_str_idx                  || sctx->sifted_states[to_idx] == NULL)                continue;              if (!STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node))                continue;              if (check_dst_limits (dfa, &sctx->limits, mctx, node,                                    str_idx, dfa->nexts[node], to_idx))                continue;              if (sctx->check_subexp == dfa->nodes[node].opr.idx)                {                  char *buf;                  buf = (char *) re_string_get_buffer (mctx->input);                  if (strncmp (buf + entry->subexp_from,                               buf + cur_bkref_idx, subexp_len) != 0)                    continue;                  err = match_ctx_add_entry (mctx, sctx->cur_bkref,                                             cur_bkref_idx, entry->subexp_from,                                             entry->subexp_to);                  if (BE (err != REG_NOERROR, 0))                    return err;                  err = clean_state_log_if_need (mctx, cur_bkref_idx                                                 + subexp_len);                  if (BE (err != REG_NOERROR, 0))                    return err;                }              else                {                  re_dfastate_t *cur_state;                  entry->flag = 0;                  for (disabled_idx = enabled_idx + 1;                       disabled_idx < mctx->nbkref_ents; ++disabled_idx)                    {                      struct re_backref_cache_entry *entry2;                      entry2 = mctx->bkref_ents + disabled_idx;                      if (entry2->node != node || entry2->str_idx != str_idx)                        continue;                      entry2->flag = 1;                    }                  if (local_sctx.sifted_states == NULL)                    {                      local_sctx = *sctx;                      err = re_node_set_init_copy (&local_sctx.limits,                                                   &sctx->limits);                      if (BE (err != REG_NOERROR, 0))                        return err;                    }                  local_sctx.last_node = node;                  local_sctx.last_str_idx = str_idx;                  err = re_node_set_insert (&local_sctx.limits, enabled_idx);                  if (BE (err < 0, 0))                    return REG_ESPACE;                  cur_state = local_sctx.sifted_states[str_idx];                  err = sift_states_backward (preg, mctx, &local_sctx);                  if (BE (err != REG_NOERROR, 0))                    return err;                  if (sctx->limited_states != NULL)                    {                      err = merge_state_array (dfa, sctx->limited_states,                                               local_sctx.sifted_states,                                               str_idx + 1);                      if (BE (err != REG_NOERROR, 0))                        return err;                    }                  local_sctx.sifted_states[str_idx] = cur_state;                  re_node_set_remove (&local_sctx.limits, enabled_idx);		  /* We must not use the variable entry here, since		     mctx->bkref_ents might be realloced.  */		  mctx->bkref_ents[enabled_idx].flag = 1;                }            }          for (enabled_idx = 0; enabled_idx < mctx->nbkref_ents; ++enabled_idx)            {              struct re_backref_cache_entry *entry;              entry = mctx->bkref_ents + enabled_idx;              if (entry->node == node && entry->str_idx == str_idx)                entry->flag = 0;            }        }    }  if (local_sctx.sifted_states != NULL)    {      re_node_set_free (&local_sctx.limits);    }  return REG_NOERROR;}