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.173 2003/06/01 18:35:13 mast Exp $ + || $Id: encode.c,v 1.174 2003/06/01 18:37:19 mast 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:20:   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"   #include "pikecode.h"    - RCSID("$Id: encode.c,v 1.173 2003/06/01 18:35:13 mast Exp $"); + RCSID("$Id: encode.c,v 1.174 2003/06/01 18:37:19 mast Exp $");    - #define ENCODE_DEBUG + /* #define ENCODE_DEBUG */      /* Use the old encoding method for programs. */   /* #define OLD_PIKE_ENCODE_PROGRAM */      #ifdef ENCODE_DEBUG   /* Pass a nonzero integer as the third arg to encode_value,    * encode_value_canonic and decode_value to activate this debug. */   #define EDB(N,X) do { debug_malloc_touch(data); if (data->debug>=N) {X;} } while (0)   #else   #define EDB(N,X) do { debug_malloc_touch(data); } while (0)
pike.git/src/encode.c:2014:    low_decode_type(data); \    (X)=pop_unfinished_type(); \   } while(0)      static void cleanup_new_program_decode (int *orig_compilation_depth)   {    end_first_pass(0);    compilation_depth = *orig_compilation_depth;   }    - static DECLSPEC(noreturn) void decode_error (struct svalue *decoding, -  struct svalue *other, -  char *msg, ...) -  ATTRIBUTE((noreturn,format (printf, 3, 4))); -  - static DECLSPEC(noreturn) void decode_error (struct svalue *decoding, -  struct svalue *other, -  char *msg, ...) - { -  int n = 0; -  char buf[4096]; -  va_list args; -  va_start (args, msg); - #ifdef HAVE_VSNPRINTF -  vsnprintf(buf, 4090, msg, args); - #else /* !HAVE_VSNPRINTF */ -  VSPRINTF(buf, msg, args); - #endif /* HAVE_VSNPRINTF */ -  va_end (args); -  -  if (decoding) { -  push_constant_text ("Error while decoding "); n++; -  push_text (get_name_of_type (decoding->type)); n++; -  push_constant_text (" "); n++; -  push_constant_text ("%O"); -  push_svalue (decoding); -  f_sprintf (2); n++; -  push_constant_text (":\n"); n++; -  } -  push_text (buf); n++; -  if (other) { -  push_constant_text ("%O\n"); -  push_svalue (other); -  f_sprintf (2); n++; -  } -  f_add (n); -  -  f_backtrace (0); -  f_aggregate (2); -  -  free_svalue(& throw_value); -  dmalloc_touch_svalue(Pike_sp-1); -  throw_value = *--Pike_sp; -  throw_severity = THROW_ERROR; -  pike_throw(); - } -  +    static void decode_value2(struct decode_data *data)      #ifdef PIKE_DEBUG   #undef decode_value2   #define decode_value2(X) do { struct svalue *_=Pike_sp; decode_value2_(X); if(Pike_sp!=_+1) Pike_fatal("decode_value2 failed!\n"); } while(0)   #endif         {    INT32 what, e, num, numh;
pike.git/src/encode.c:2318:   #endif    return;    }       case TAG_OBJECT:    {    tmp=data->counter;    data->counter.u.integer++;       decode_value2(data); -  stack_dup(); +        switch(num)    {    case 0:    if(data->codec)    {    apply(data->codec,"objectof", 1);    }else{    fallback_codec();    }
pike.git/src/encode.c:2414:   #endif    case 3:    pop_stack();    decode_value2(data);    break;       default:    Pike_error("Object coding not compatible.\n");    break;    } -  +     if(Pike_sp[-1].type != T_OBJECT)    if(data->pickyness) -  decode_error(Pike_sp - 2, Pike_sp - 1, -  "Failed to decode object. Got: "); -  pop_stack(); +  Pike_error("Failed to decode object.\n");       break;    }       case TAG_FUNCTION:    tmp=data->counter;    data->counter.u.integer++; -  +     decode_value2(data);       switch(num)    {    case 0:    if(data->codec)    {    apply(data->codec,"functionof", 1);    }else{    fallback_codec();
pike.git/src/encode.c:2468:    }    }    pop_stack();    break;    }       default:    Pike_error("Function coding not compatible.\n");    break;    } -  +     if(data->pickyness && Pike_sp[-1].type != T_FUNCTION) -  decode_error(NULL, Pike_sp - 1, "Failed to decode function. Got: "); -  +  Pike_error("Failed to decode function.\n");    break;          case TAG_PROGRAM:    EDB(3,    fprintf(stderr, "%*s TAG_PROGRAM(%d)\n",    data->depth, "", num));    switch(num)    {    case 0:
pike.git/src/encode.c:2504:    if(data->codec)    {    apply(data->codec,"programof", 1);    }else{    fallback_codec();    }       p = program_from_svalue(Pike_sp-1);       if (!p) { -  if(data->pickyness) -  decode_error(prog_code, Pike_sp - 1, -  "Failed to decode program. Got: "); +  if(data->pickyness) { +  if ((prog_code->type == T_STRING) && +  (prog_code->u.string->len < 128) && +  (!prog_code->u.string->size_shift)) { +  Pike_error("Failed to decode program \"%s\".\n", +  prog_code->u.string->str); +  } +  Pike_error("Failed to decode program.\n"); +  }    pop_n_elems(2);    push_undefined();    break;    }    /* Remove the extra entry from the stack. */    ref_push_program(p);    stack_pop_2_elems_keep_top();    break;    }   
pike.git/src/encode.c:2611:    case T_INT:    p->parent=0;    break;    case T_PROGRAM:    p->parent=Pike_sp[-1].u.program;    break;    case T_FUNCTION:    p->parent=program_from_svalue(Pike_sp-1);    break;    default: -  decode_error(NULL, Pike_sp - 1, "Program decode failed. Got: "); +  Pike_error("Program decode failed!\n");    }    if(p->parent) {    add_ref(p->parent);    }    pop_stack();       debug_malloc_touch(p);      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \    decode_number( p->PIKE_CONCAT(num_,NAME), data);
pike.git/src/encode.c:2675: Inside #if defined(DECODE_PROGRAM)
  #ifdef DECODE_PROGRAM    {    int byteorder = PIKE_BYTEORDER; /* FIXME: Used by bytecode.h */    DECODE_PROGRAM(p);    }   #endif /* DECODE_PROGRAM */    make_program_executable(p);       getdata2(p->linenumbers, p->num_linenumbers);    -  /* Now with the linenumber info in place it gets useful to -  * include the program in error messages. */ -  +    #ifdef DEBUG_MALLOC    if(p->num_linenumbers && p->linenumbers &&    EXTRACT_UCHAR(p->linenumbers)==127)    {    char *foo = p->linenumbers + 1;    int len = get_small_number(&foo);    int shift = *foo;    char *fname = ++foo;    foo += len << shift;    get_small_number(&foo); /* pc offset */
pike.git/src/encode.c:2701:   #endif          debug_malloc_touch(p);    for(d=0;d<p->num_identifier_index;d++)    {    decode_number(p->identifier_index[d],data);    if(p->identifier_index[d] > p->num_identifier_references)    {    p->identifier_index[d]=0; -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, "Malformed program in decode.\n"); +  Pike_error("Malformed program in decode.\n");    }    }       debug_malloc_touch(p);    for(d=0;d<p->num_variable_index;d++)    {    decode_number(p->variable_index[d],data);    if(p->variable_index[d] > p->num_identifiers)    {    p->variable_index[d]=0; -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, "Malformed program in decode.\n"); +  Pike_error("Malformed program in decode.\n");    }    }       debug_malloc_touch(p);    for(d=0;d<p->num_identifier_references;d++)    {    decode_number(p->identifier_references[d].inherit_offset,data);    if(p->identifier_references[d].inherit_offset > p->num_inherits)    {    p->identifier_references[d].inherit_offset=0; -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, "Malformed program in decode.\n"); +  Pike_error("Malformed program in decode.\n");    }    decode_number(p->identifier_references[d].identifier_offset,data);    decode_number(p->identifier_references[d].id_flags,data);       EDB(3,fprintf(stderr,"IDREF%x < %d: { %d, %d, %d }\n",    p->id,d,    p->identifier_references[d].inherit_offset,    p->identifier_references[d].identifier_offset,    p->identifier_references[d].id_flags); );    }
pike.git/src/encode.c:2757:      /* p->inherits[0].prog=p;    p->inherits[0].parent_offset=1;   */       if(placeholder && data->pass==1)    {    if(placeholder->prog != null_program)    {    debug_malloc_touch(placeholder); -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Placeholder argument is not a null_program clone.\n"); +  Pike_error("Placeholder argument is not a null_program clone!");    }else{    free_program(placeholder->prog);    add_ref(placeholder->prog = p);    debug_malloc_touch(placeholder);    }    }       debug_malloc_touch(p);       in=p->num_inherits;
pike.git/src/encode.c:2782:    decode_number(p->inherits[d].inherit_level,data);    decode_number(p->inherits[d].identifier_level,data);    decode_number(p->inherits[d].parent_offset,data);    decode_number(p->inherits[d].parent_identifier,data);    decode_number(p->inherits[d].storage_offset,data);       decode_value2(data);    if(d==0)    {    if(Pike_sp[-1].type != T_PROGRAM || -  Pike_sp[-1].u.program != p) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Program decode of self inherit failed. Got: "); -  } +  Pike_sp[-1].u.program != p) +  Pike_error("Program decode failed!\n");    sub_ref(p);    }       if(data->pass > 1)    {    if(p->inherits[d].prog)    {    free_program(p->inherits[d].prog);    p->inherits[d].prog=0;    }       if(p->inherits[d].parent)    {    free_object(p->inherits[d].parent);    p->inherits[d].parent=0;    }    }       switch(Pike_sp[-1].type)    { -  case T_PROGRAM: -  EDB(3, fprintf(stderr,"INHERIT%x = prog\n",p->id); ); -  p->inherits[d].prog=Pike_sp[-1].u.program; -  Pike_sp--; -  dmalloc_touch_svalue(Pike_sp); -  break; -  +     case T_FUNCTION: -  if(Pike_sp[-1].subtype != FUNCTION_BUILTIN) { +  if(Pike_sp[-1].subtype == FUNCTION_BUILTIN) +  Pike_error("Failed to decode parent.\n"); +     EDB(3, fprintf(stderr,"INHERIT%x = func { %p, %d} \n",p->id,Pike_sp[-1].u.object, Pike_sp[-1].subtype); );       p->inherits[d].parent_identifier=Pike_sp[-1].subtype;    p->inherits[d].prog=program_from_svalue(Pike_sp-1); -  if(!p->inherits[d].prog) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Failed to decode inherited program. Got: "); -  } +  if(!p->inherits[d].prog) +  Pike_error("Failed to decode parent.\n");    add_ref(p->inherits[d].prog);    p->inherits[d].parent=Pike_sp[-1].u.object;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    break; -  } -  /* Fall through */ +     -  +  case T_PROGRAM: +  EDB(3, fprintf(stderr,"INHERIT%x = prog\n",p->id); ); +  p->inherits[d].prog=Pike_sp[-1].u.program; +  Pike_sp--; +  dmalloc_touch_svalue(Pike_sp); +  break;    default: -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Failed to decode inherited program. Got: "); +  Pike_error("Failed to decode inheritance.\n");    }       p->num_inherits=d+1;       getdata3(p->inherits[d].name);       EDB(3, fprintf(stderr,"INHERIT%x < %d: %d id=%d\n",    p->id,d,    p->inherits[d].prog->num_identifiers,    p->inherits[d].prog->id); );
pike.git/src/encode.c:2867:    {    getdata(p->identifiers[d].name);    decode_type(p->identifiers[d].type,data);    decode_number(p->identifiers[d].identifier_flags,data);    decode_number(p->identifiers[d].run_time_type,data);    decode_number(p->identifiers[d].opt_flags,data);    if (!(p->identifiers[d].identifier_flags & IDENTIFIER_C_FUNCTION))    {    decode_number(p->identifiers[d].func.offset,data);    } else { -  ref_push_program (p); -  ref_push_string (p->identifiers[d].name); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Cannot decode function implemented in C: "); +  Pike_error("Cannot decode functions implemented in C " +  "(identifier='%s').\n", +  p->identifiers[d].name->str);    }    }          UNSET_ONERROR(err2);    UNSET_ONERROR(err1);       debug_malloc_touch(dat);       debug_malloc_touch(p);
pike.git/src/encode.c:2923: Inside #if defined(PIKE_DEBUG)
   {    int q;    for(q=0;q<p->num_inherits;q++)    if(!p->inherits[q].prog)    Pike_fatal("FOOBAR!@!!!\n");    }   #endif       if(placeholder && data->pass == 1)    { -  if(placeholder->storage) +  if(!p || (placeholder->storage))    { -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, "Placeholder already has storage!\n"); +  Pike_error("Placeholder already has storage!\n");    } else {    placeholder->storage=p->storage_needed ?    (char *)xalloc(p->storage_needed) :    (char *)0;    call_c_initializers(placeholder);    }    }       data->pickyness--;   
pike.git/src/encode.c:3067:    data->counter.u.integer++;    decode_value2(data);    decode_value2(data);    if(Pike_sp[-2].type==T_INT)    {    pop_stack();    }else{    f_arrow(2);    }    if(data->pickyness && Pike_sp[-1].type != T_PROGRAM) -  decode_error(NULL, Pike_sp - 1, "Failed to decode program. Got: "); +  Pike_error("Failed to decode program.\n");    break;       case 3:    tmp=data->counter;    data->counter.u.integer++;    decode_value2(data);    if ((Pike_sp[-1].type == T_INT) &&    (Pike_sp[-1].u.integer < PROG_DYNAMIC_ID_START) &&    (Pike_sp[-1].u.integer > 0)) {    struct program *p = id_to_program(Pike_sp[-1].u.integer);    if (!p) {    Pike_error("Failed to decode program %"PRINTPIKEINT"d\n",    Pike_sp[-1].u.integer);    }    pop_stack();    ref_push_program(p);    } else { -  decode_error(NULL, Pike_sp - 1, -  "Failed to decode program by ID. Expected integer, got: "); +  Pike_error("Failed to decode program.\n");    }    break;       case 4:    {    struct program *p;    ONERROR err;    int orig_compilation_depth;    int byteorder;    int bytecode_method;
pike.git/src/encode.c:3232:    /* Decode linenumbers */    if (data->ptr + (int)local_num_linenumbers >= data->len) {    Pike_error("Failed to decode linenumbers. (string too short)\n");    }    for (e=0; e<(int)local_num_linenumbers; e++) {    char lineno_info;    lineno_info = *(data->data + data->ptr++);    add_to_linenumbers(lineno_info);    }    -  /* Now with the linenumber info in place it gets useful to -  * include the program in error messages. */ -  +     /* identifier_index & variable_index are created by    * fixate_program() and optimize_program().    */       /* Decode strings */    for (e=0; e<local_num_strings; e++) {    decode_value2(data);    if (Pike_sp[-1].type != T_STRING) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Non strings in string table: "); +  Pike_error("Non strings in string table.\n");    }    add_to_strings(Pike_sp[-1].u.string);    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    }       /* Place holder constants.    *    * These will be replaced later on.    */
pike.git/src/encode.c:3302:    /* Actually the id ref number from the inherited program */    decode_number(ref_no, data);    ref.identifier_offset = p->inherits[ref.inherit_offset].prog->    identifier_references[ref_no].identifier_offset;       /* Expected identifier reference number */    decode_number(no, data);       if (no > p->num_identifier_references) {    EDB (3, dump_program_tables (p, data->depth)); -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Bad identifier reference offset: %d != %d\n", no, +  Pike_error("Bad identifier reference offset: %d != %d\n", no,    Pike_compiler->new_program->    num_identifier_references);    } else if (no == p->num_identifier_references) {    add_to_identifier_references(ref);    }    else {    p->identifier_references[no] = ref;    }    }    break;       case ID_ENTRY_VARIABLE:    {    int no;       /* name */    decode_value2(data);    if (Pike_sp[-1].type != T_STRING) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad variable name (not a string): "); +  Pike_error("Bad variable name (not a string)\n");    }       /* type */    decode_value2(data);    if (Pike_sp[-1].type != T_TYPE) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad variable type (not a type): "); +  Pike_error("Bad variable type (not a type)\n");    }       /* Expected identifier offset */    decode_number(no, data);       EDB(5,    fprintf(stderr,    "%*sdefine_variable(\"%s\", X, 0x%04x)\n",    data->depth, "",    Pike_sp[-2].u.string->str, id_flags));       /* Alters    *    * storage, variable_index, identifiers and    * identifier_references    */    if (no != define_variable(Pike_sp[-2].u.string,    Pike_sp[-1].u.type,    id_flags)) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Bad variable identifier offset: %d\n", no); +  Pike_error("Bad variable identifier offset: %d\n", no);    }       pop_n_elems(2);    }    break;    case ID_ENTRY_FUNCTION:    {    union idptr func;    unsigned INT8 func_flags;    unsigned INT16 opt_flags;    int no;    int n;       /* name */    decode_value2(data);    if (Pike_sp[-1].type != T_STRING) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad function name (not a string): "); +  Pike_error("Bad function name (not a string)\n");    }       /* type */    decode_value2(data);    if (Pike_sp[-1].type != T_TYPE) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad function type (not a type): "); +  Pike_error("Bad function type (not a type)\n");    }       /* func_flags (aka identifier_flags) */    decode_number(func_flags, data);       /* func */    decode_number(func.offset, data);       /* opt_flags */    decode_number(opt_flags, data);
pike.git/src/encode.c:3430:    */    n = define_function(Pike_sp[-2].u.string,    Pike_sp[-1].u.type,    id_flags, func_flags,    &func, opt_flags);    if (no != n &&    (p->identifier_references[no].id_flags != id_flags ||    p->identifier_references[no].identifier_offset !=    p->identifier_references[n].identifier_offset ||    p->identifier_references[no].inherit_offset != 0)) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Bad function identifier offset: %d\n", no); +  Pike_error("Bad function identifier offset: %d\n", no);    }       pop_n_elems(2);    }    break;    case ID_ENTRY_CONSTANT:    {    struct identifier id;    struct reference ref;    int no;    int n;       /* name */    decode_value2(data);    if (Pike_sp[-1].type != T_STRING) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad constant name (not a string): "); +  Pike_error("Bad function name (not a string)\n");    }    id.name = Pike_sp[-1].u.string;       /* identifier_flags */    id.identifier_flags = IDENTIFIER_CONSTANT;       /* offset */    decode_number(id.func.offset, data);       /* FIXME:    * Verify validity of func.offset    */       /* type */    decode_value2(data);    if (Pike_sp[-1].type != T_TYPE) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad constant type (not a type): "); +  Pike_error("Bad function type (not a type)\n");    }    id.type = Pike_sp[-1].u.type;       /* run_time_type */    decode_number(id.run_time_type, data);       /* Expected identifier number. */    decode_number(no, data);       n = isidentifier(id.name);
pike.git/src/encode.c:3514:    *    * 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 %d for ", no); +  if (id.name->size_shift) +  Pike_error("Bad constant identifier offset: %d\n", no); +  else +  Pike_error("Bad constant identifier offset %d for %s\n", +  no, id.name->str);    }       add_to_identifiers(id);    dmalloc_touch_svalue(Pike_sp-1);    dmalloc_touch_svalue(Pike_sp-2);    Pike_sp -= 2;    }    break;    case ID_ENTRY_INHERIT:    {    struct program *prog;    struct object *parent = NULL;    int parent_identifier;    int parent_offset;    struct pike_string *name = NULL;    int no;       decode_number(no, data);    if (no !=    Pike_compiler->new_program->num_identifier_references) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Bad inherit identifier offset: %d\n", no); +  Pike_error("Bad inherit identifier offset: %d\n", no);    }       /* name */    decode_value2(data);    if (Pike_sp[-1].type == T_STRING) {    name = Pike_sp[-1].u.string;    } else if ((Pike_sp[-1].type != T_INT) ||    Pike_sp[-1].u.integer) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad inherit name (not a string): "); +  Pike_error("Bad function name (not a string)\n");    }       /* prog */    decode_value2(data);    if (Pike_sp[-1].type != T_PROGRAM) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad inherit: Expected program, got "); +  Pike_error("Bad inherit: Expected program, got %s\n", +  get_name_of_type(Pike_sp[-1].type));    }    prog = Pike_sp[-1].u.program; -  if (prog == placeholder_program) { -  ref_push_program (p); -  decode_error (Pike_sp - 1, NULL, -  "Trying to inherit placeholder program " -  "(resolver or codec problem).\n"); -  } -  if(!(prog->flags & (PROGRAM_FINISHED | PROGRAM_PASS_1_DONE))) { -  ref_push_program (p); -  decode_error (Pike_sp - 1, Pike_sp - 2, -  "Cannot inherit a program which is not " -  "fully compiled yet (resolver or codec problem):\n"); -  } +        /* parent */    decode_value2(data);    if (Pike_sp[-1].type == T_OBJECT) {    parent = Pike_sp[-1].u.object;    } else if ((Pike_sp[-1].type != T_INT) ||    Pike_sp[-1].u.integer) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Bad inherit: Parent isn't an object: "); +  Pike_error("Bad inherit: Parent isn't an object.\n");    }       /* parent_identifier */    decode_number(parent_identifier, data);       /* parent_offset */    decode_number(parent_offset, data);       /* Expected number of identifier references. */    decode_number(no, data);       if (prog->num_identifier_references != no) { -  ref_push_program (p); -  decode_error(Pike_sp - 1, NULL, -  "Bad number of identifiers in inherit: %d != %d\n", -  no, prog->num_identifier_references); +  Pike_error("Bad number of identifiers in inherit: %d\n", no);    }       EDB(5,    fprintf(stderr,    "%*slow_inherit(..., \"%s\")\n",    data->depth, "",    name?name->str:"NULL"));       /* Alters    *
pike.git/src/encode.c:3641:    Pike_compiler->num_parse_error--;       p->flags |= PROGRAM_PASS_1_DONE;       EDB(5, dump_program_tables(p, data->depth));       /* Fixate & optimize    *    * lfuns and identifier_index    */ -  ref_push_program (p); +     if (!(p = end_first_pass(2))) { -  decode_error(Pike_sp - 1, NULL, "Failed to decode program.\n"); +  Pike_error("Failed to decode program.\n");    } -  pop_stack(); +     compilation_depth = orig_compilation_depth;    push_program(p);       /* Verify... */ - #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \ -  if (PIKE_CONCAT(local_num_, NAME) != p->PIKE_CONCAT(num_,NAME)) { \ -  ref_push_program (p); \ -  decode_error(Pike_sp - 1, NULL, \ -  "Value mismatch for num_" TOSTR(NAME) ": %d != %d\n", \ -  PIKE_CONCAT(local_num_, NAME), \ -  p->PIKE_CONCAT(num_, NAME)); \ + #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \ +  if (PIKE_CONCAT(local_num_, NAME) != p->PIKE_CONCAT(num_,NAME)) { \ +  Pike_error("Value mismatch for num_" TOSTR(NAME) ": %d != %d\n", \ +  PIKE_CONCAT(local_num_, NAME), \ +  p->PIKE_CONCAT(num_, NAME)); \    }   #include "program_areas.h"       /* Decode the actual constants    *    * This must be done after the program has been ended.    */    for (e=0; e<local_num_constants; e++) {    struct program_constant *constant = p->constants+e;    /* value */    decode_value2(data);    /* name */    decode_value2(data);    if (Pike_sp[-1].type == T_STRING) {    constant->name = Pike_sp[-1].u.string;    } else if ((Pike_sp[-1].type == T_INT) &&    !Pike_sp[-1].u.integer) {    constant->name = NULL;    } else { -  ref_push_program (p); -  decode_error(Pike_sp - 1, Pike_sp - 2, -  "Name of constant is not a string: "); +  Pike_error("Name of constant is not a string.\n");    }    constant->sval = Pike_sp[-2];    dmalloc_touch_svalue(Pike_sp-1);    dmalloc_touch_svalue(Pike_sp-2);    Pike_sp -= 2;    }       data->pickyness--;       /* The program should be consistent now. */