pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:3866:       if(delay)    {    debug_malloc_touch(data);    /* We have been delayed */    return;    }      #ifdef PIKE_DEBUG    if (!free_after_error) { -  NEW_MAPPING_LOOP (data->decoded->data) { -  if (TYPEOF(k->val) == T_PROGRAM && -  !(k->val.u.program->flags & PROGRAM_FINISHED)) { -  decode_error (data, NULL, -  "Got unfinished program <%O> after decode: %O\n", -  &k->ind, &k->val); -  } -  } +     if(data->unfinished_programs)    Pike_fatal("We have unfinished programs left in decode()!\n");    if(data->unfinished_objects)    Pike_fatal("We have unfinished objects left in decode()!\n");    if(data->unfinished_placeholders)    Pike_fatal("We have unfinished placeholders left in decode()!\n");    }   #endif    -  free_string (data->data_str); +     if (data->codec) free_object (data->codec); -  free_mapping(data->decoded); +        while(data->unfinished_programs)    {    struct unfinished_prog_link *tmp=data->unfinished_programs;    data->unfinished_programs=tmp->next;    free(tmp);    }       while(data->unfinished_objects)    {
pike.git/src/encode.c:3916:    data->unfinished_placeholders=tmp->next;    free_object(tmp->o);    free(tmp);    }      #ifdef PIKE_THREADS    data->thread_state = NULL;    free_object (data->thread_obj);   #endif    + #ifdef PIKE_DEBUG +  if (!free_after_error) { +  NEW_MAPPING_LOOP (data->decoded->data) { +  if (TYPEOF(k->val) == T_PROGRAM && +  !(k->val.u.program->flags & PROGRAM_FINISHED)) { +  ONERROR err; +  /* Move some references to the stack so that they +  * will be freed when decode_error() throws, but +  * still be available to decode_error(). +  */ +  push_string(data->data_str); +  push_mapping(data->decoded); +  SET_ONERROR(err, data, free); +  +  decode_error (data, NULL, +  "Got unfinished program <%O> after decode: %O\n", +  &k->ind, &k->val); +  UNSET_ONERROR(err); +  } +  } +  } + #endif +  free_string(data->data_str); +  free_mapping(data->decoded);    free( (char *) data);   }      static void low_do_decode (struct decode_data *data)   {    current_decode = data;       decode_value2(data);       while (data->ptr < data->len) {