pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:459:    * We can't dump B when the type is encountered inside A, since    * upon decode B won't have a complete A to inherit then.    */    encode_value2(Pike_sp-1, data, 0);    pop_stack();    break;    }    }   }    - static void zap_unfinished_program(struct program *p) - { -  int e; -  debug_malloc_touch(p); -  if(p->flags & PROGRAM_FIXED) return; /* allow natural zapping */ -  debug_malloc_touch(p); -  if(p->parent) -  { -  free_program(p->parent); -  p->parent=0; -  } -  for(e=0;e<p->num_constants;e++) -  { -  free_svalue(& p->constants[e].sval); -  mark_free_svalue (&p->constants[e].sval); -  } -  -  for(e=0;e<p->num_inherits;e++) -  { -  if(p->inherits[e].parent) -  { -  free_object(p->inherits[e].parent); -  p->inherits[e].parent=0; -  } -  if(e) -  { -  if(p->inherits[e].prog) -  { -  free_program(p->inherits[e].prog); -  p->inherits[e].prog=0; -  } -  } -  } - } -  +    /* force_encode == 0: Maybe dump the thing later, and only a forward    * reference here (applies to programs only).    *    * force_encode == 1: Dump the thing now.    *    * force_encode == 2: A forward reference has been encoded to this    * thing. Now it's time to dump it. */      static void encode_value2(struct svalue *val, struct encode_data *data, int force_encode)   
pike.git/src/encode.c:2047:      static int my_extract_char(struct decode_data *data)   {    if(data->ptr >= data->len)    Pike_error("Decode error: Not enough data in string.\n");    return data->data [ data->ptr++ ];   }      static DECLSPEC(noreturn) void decode_error (    struct decode_data *data, struct svalue *decoding, const char *msg, ...) -  ATTRIBUTE((noreturn)); +  ATTRIBUTE((noinline,noreturn));      static DECLSPEC(noreturn) void decode_error (    struct decode_data *data, struct svalue *decoding, const char *msg, ...)   {    int n = 0;    va_list args;    struct string_builder sb;    struct object *o = fast_clone_object (decode_error_program);    struct decode_error_struct *dec =    (struct decode_error_struct *) (o->storage + decode_error_offset); -  struct generic_error_struct *gen = -  (struct generic_error_struct *) get_storage (o, generic_error_program); +  struct generic_error_struct *gen = get_storage (o, generic_error_program);       ASSERT_THREAD_SWAPPED_IN();       copy_shared_string (dec->decode_string, data->data_str);       if (decoding) {    push_text ("Error while decoding "); n++;    push_text ("%O");    push_svalue (decoding);    f_sprintf (2); n++;
pike.git/src/encode.c:2443:    debug_malloc_touch(placeholder);    destruct(placeholder);    } else {    free_program(placeholder->prog);    placeholder->prog = NULL;    debug_malloc_touch(placeholder);    }    free_object(placeholder);   }    - static int init_placeholder(struct object *placeholder); +     -  +    #define SETUP_DECODE_MEMOBJ(TYPE, U, VAR, ALLOCATE,SCOUR) do { \    struct svalue *tmpptr; \    struct svalue tmp; \    if(data->pass > 1 && \    (tmpptr=low_mapping_lookup(data->decoded, & entry_id))) \    { \    tmp=*tmpptr; \    VAR=tmp.u.U; \    SCOUR; \    }else{ \
pike.git/src/encode.c:4157:      decode_done:;    EDB(2,fprintf(stderr, "%*sDecoded to <%d>: ", data->depth, "", entry_id.u.integer);    print_svalue(stderr, Pike_sp-1);    fputc('\n', stderr););   #ifdef ENCODE_DEBUG    data->depth -= 2;   #endif   }    - /* Placed after to prevent inlining */ - static int init_placeholder(struct object *placeholder) - { -  JMP_BUF rec; -  /* Initialize the placeholder. */ -  if(SETJMP(rec)) -  { -  dmalloc_touch_svalue(&throw_value); -  call_handle_error(); -  zap_placeholder(placeholder); -  UNSETJMP(rec); -  return 1; -  }else{ -  call_pike_initializers(placeholder,0); -  UNSETJMP(rec); -  return 0; -  } - } -  -  -  +    static struct decode_data *current_decode = NULL;      static void free_decode_data (struct decode_data *data, int delay,    int DEBUGUSED(free_after_error))   {   #ifdef PIKE_DEBUG    int e;    struct keypair *k;   #endif