Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at index-sort-string.c:205

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

index_sort_node_add

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-sort-string.c)expand/collapse
Show more  
 162  static void index_sort_node_add(struct sort_string_context *ctx,
 163                                  struct mail_sort_node *node)
 164  {
 165          struct index_transaction_context *t =
 166                  (struct index_transaction_context *)ctx->program->t;
 167          struct mail_index_map *map;
 168          const void *data;
 169          uint32_t reset_id;
 170          bool expunged;
 171   
 172          mail_index_lookup_ext_full(t->trans_view, node->seq,
 173                                     ctx->ext_id, &map, &data, &expunged);
 174          if (expunged) {
 175                  /* we don't want to update expunged messages' sort IDs */
 176                  node->no_update = TRUE;
 177                  /* we can't trust expunged messages' sort IDs. they might be 
 178                     valid, but it's also possible that sort IDs were updated 
 179                     and the expunged messages' sort IDs became invalid. we could
 180                     use sort ID if we could know the extension's reset_id at the 
 181                     time of the expunge so we could compare it to 
 182                     highest_reset_id, but this isn't currently possible. */
 183                  node->sort_id = 0;
 184          } else {
 185                  node->sort_id = data == NULL ? 0 : *(const uint32_t *)data;
 186                  if (node->sort_id == 0) {
 187                          if (ctx->lowest_nonexpunged_zero > node->seq ||
 188                              ctx->lowest_nonexpunged_zero == 0)
 189                                  ctx->lowest_nonexpunged_zero = node->seq;
 190                  } else {
 191                          i_assert(ctx->lowest_nonexpunged_zero == 0 ||
 192                                   ctx->lowest_nonexpunged_zero > node->seq);
 193                  }
 194          }
 195   
 196          if (node->sort_id != 0) {
 197                  /* if reset ID increases, lookup all existing messages' sort 
 198                     IDs again. if it decreases, ignore the sort ID. */
 199                  if (!mail_index_ext_get_reset_id(t->trans_view, map,
 200                                                   ctx->ext_id, &reset_id))
 201                          reset_id = 0;
 202                  if (reset_id != ctx->highest_reset_id) {
 203                          if (reset_id < ctx->highest_reset_id) {
 204                                  i_assert(expunged);
 205                                  node->sort_id = 0;
 206                          } else if (ctx->have_all_wanted) {
 207                                  /* a bit late to start changing the reset_id.
 208                                     the node lists aren't ordered by sequence 
 209                                     anymore. */
 210                                  node->sort_id = 0;
 211                                  ctx->no_writing = TRUE;
 212                          } else {
 213                                  ctx->highest_reset_id = reset_id;
 214                                  index_sort_reget_sort_ids(ctx);
 215                          }
 216                  }
 217          }
 218   
 219          if (node->sort_id == 0)
 220                  array_append(&ctx->zero_nodes, node, 1);
 221          else 
 222                  array_append(&ctx->nonzero_nodes, node, 1);
 223          if (ctx->last_seq < node->seq)
 224                  ctx->last_seq = node->seq;
 225  }
Show more  




Change Warning 7526.24578 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: