pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: encode.c,v 1.255 2008/02/07 15:02:48 mast Exp $ + || $Id: encode.c,v 1.256 2008/02/08 18:40:25 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"
pike.git/src/encode.c:1387:    code_number(ref->id_flags, data);       /* inherit_offset */    code_number(ref->inherit_offset, data);       /* identifier_offset */    /* Find the corresponding identifier reference    * in the inherit. */    {    struct program *p2 = p->inherits[ref->inherit_offset].prog; +  int i;    debug_malloc_touch(p);    debug_malloc_touch(p2); -  int i; +     for (i=0; i < p2->num_identifier_references; i++) {    struct reference *ref2 = p2->identifier_references + i;    if (!(ref2->inherit_offset) &&    !(ref2->id_flags & ID_HIDDEN) &&    (ref2->identifier_offset == ref->identifier_offset)) {    ref_no = i;    break;    }    }    }
pike.git/src/encode.c:2354:   /* This really needs to disable threads.... */   #define decode_type(X,data) do { \    type_stack_mark(); \    low_decode_type(data); \    (X)=pop_unfinished_type(); \   } while(0)      static void cleanup_new_program_decode (int *orig_compilation_depth)   {    debug_malloc_touch(Pike_compiler->new_program); +  debug_malloc_touch(Pike_compiler->new_program->parent); +  /* The program is consistent enough to be freed... */ +  p->flags &= ~PROGRAM_AVOID_CHECK;    end_first_pass(0);    compilation_depth = *orig_compilation_depth;   }      static void set_lex_pragmas(ptrdiff_t old_pragmas)   {    lex.pragmas = DO_NOT_WARN((INT32)old_pragmas);   }      static DECLSPEC(noreturn) void decode_error (struct svalue *decoding,
pike.git/src/encode.c:2681:    ref_push_array(a);    goto decode_done;    }       case TAG_MAPPING:    {    struct mapping *m;    if(num<0)    Pike_error("Failed to decode mapping. (mapping size is negative)\n");    -  /* Heruetical */ +  /* Heuristical */    if(data->ptr + num > data->len)    Pike_error("Failed to decode mapping. (not enough data)\n");       EDB(2,fprintf(stderr, "%*sDecoding mapping of size %d to <%d>\n",    data->depth, "", num, entry_id.u.integer));       SETUP_DECODE_MEMOBJ(T_MAPPING, mapping, m, allocate_mapping(num), ; );       for(e=0;e<num;e++)    {
pike.git/src/encode.c:3887:    Pike_sp -= 2;   #else /* !0 */    constant->offset = -1;    pop_stack();    constant->sval = Pike_sp[-1];    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp -= 1;   #endif /* 0 */    decode_number(entry_type, data);    } +     while (entry_type != ID_ENTRY_EOT) {    decode_number(id_flags, data);    switch(entry_type) {    case ID_ENTRY_RAW:    {    int no;    int ref_no;    struct reference ref;       /* id_flags */
pike.git/src/encode.c:4118: Inside #if defined(PROFILING)
     #ifdef PROFILING    id.self_time=0;    id.num_calls=0;    id.total_time=0;   #endif       /* id_flags */    ref.id_flags = id_flags;    +  EDB(5, +  fprintf(stderr, +  "%*sdefining constant(\"%s\", X, 0x%04x)\n", +  data->depth, "", +  Pike_sp[-2].u.string->str, id_flags)); +     /* identifier_offset */    ref.identifier_offset =    Pike_compiler->new_program->num_identifiers;    add_to_identifiers(id);    -  +  /* References now held by the new program identifier. */ +  dmalloc_touch_svalue(Pike_sp-1); +  dmalloc_touch_svalue(Pike_sp-2); +  Pike_sp -= 2; +     /* ref.inherit_offset */    ref.inherit_offset = 0;    -  EDB(5, -  fprintf(stderr, -  "%*sdefining constant(\"%s\", X, 0x%04x)\n", -  data->depth, "", -  Pike_sp[-2].u.string->str, id_flags)); -  +     /* Alters    *    * identifiers, identifier_references    */       if (n < 0 || (n = override_identifier (&ref, id.name)) < 0) {    n = p->num_identifier_references;    add_to_identifier_references(ref);    }       if (no != n) {    ref_push_program (p);    ref_push_string (id.name);    decode_error(Pike_sp - 2, Pike_sp - 1,    "Bad function identifier offset "    "(expected %d, got %d) for ", no, n);    }    -  dmalloc_touch_svalue(Pike_sp-1); -  dmalloc_touch_svalue(Pike_sp-2); -  Pike_sp -= 2; +     }    break;    case ID_ENTRY_ALIAS:    {    int depth;    int refno;    int no;    int n;       /* name */