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.202 2003/11/25 16:46:03 grubba Exp $ + || $Id: encode.c,v 1.203 2003/11/25 21:11:55 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:25:   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"   #include "pikecode.h"   #include "pike_types.h"   #include "opcodes.h"   #include "peep.h"    - RCSID("$Id: encode.c,v 1.202 2003/11/25 16:46:03 grubba Exp $"); + RCSID("$Id: encode.c,v 1.203 2003/11/25 21:11:55 grubba Exp $");      /* #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)
pike.git/src/encode.c:3583:       /* Decode identifier_references, inherits and identifiers. */    decode_number(entry_type, data);    EDB(4,    fprintf(stderr, "%*sDecoding identifier references.\n",    data->depth, ""));   #ifdef ENCODE_DEBUG    data->depth+=2;   #endif    while (entry_type == ID_ENTRY_EFUN_CONSTANT) { +  INT32 efun_no;    struct program_constant *constant; -  decode_number(e, data); -  if ((e < 0) || (e >= local_num_constants)) { +  decode_number(efun_no, data); +  EDB(2, +  fprintf(stderr, "%*sDecoding efun constant #%d.\n", +  data->depth, "", efun_no)); +  if ((efun_no < 0) || (efun_no >= local_num_constants)) {    ref_push_program (p);    decode_error(Pike_sp - 1, NULL,    "Bad efun number: %d (expected 0 - %d).\n", -  e, local_num_constants-1); +  efun_no, local_num_constants-1);    } -  constant = p->constants+e; +  constant = p->constants+efun_no;    /* value */    decode_value2(data);    if ((Pike_sp[-2].type != T_FUNCTION) ||    (Pike_sp[-2].subtype != FUNCTION_BUILTIN)) {    ref_push_program (p);    decode_error(Pike_sp - 1, Pike_sp - 2,    "Expected efun constant: ");    }    /* name */    decode_value2(data);
pike.git/src/encode.c:3736:    "Bad function type (not a type): ");    }       /* func_flags (aka identifier_flags) */    decode_number(func_flags, data);       /* func */    decode_number(func.offset, data);    if (bytecode_method == PIKE_BYTECODE_PORTABLE &&    func.offset != -1) { +  EDB(2, +  fprintf(stderr, "%*sDecoding portable bytecode.\n", +  data->depth, ""));    func.offset = decode_portable_bytecode(func.offset);    }       /* opt_flags */    decode_number(opt_flags, data);       /* FIXME:    * Verify validity of func_flags, func.offset & opt_flags    */   
pike.git/src/encode.c:4564: Inside #if defined(ENCODE_DEBUG)
   * other uses in the future. */    BIT_VOID | BIT_INT,   #endif    0);       s = Pike_sp[-args].u.string;       switch (args) {    default:   #ifdef ENCODE_DEBUG -  debug = Pike_sp[4-args].u.integer; +  debug = Pike_sp[2-args].u.integer;    /* Fall through. */    case 2:   #endif    if (Pike_sp[1-args].type == T_OBJECT) {    codec = Pike_sp[1-args].u.object;    break;    }    /* Fall through. */    case 1:    codec = get_master();