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.263 2008/04/14 10:14:38 grubba Exp $ + || $Id: encode.c,v 1.264 2008/04/26 19:04: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:2397:    } \   }while(0)      /* 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) + static void cleanup_new_program_decode (void *ignored)   {    debug_malloc_touch(Pike_compiler->new_program);    debug_malloc_touch(Pike_compiler->new_program->parent);    /* The program is consistent enough to be freed... */    Pike_compiler->new_program->flags &= ~PROGRAM_AVOID_CHECK;    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, ...)
pike.git/src/encode.c:3631:   #endif       break;    }       case 4: /* New-style encoding. */    {    struct program *p;    ONERROR err;    ONERROR err2; -  int orig_compilation_depth; +     int byteorder;    int bytecode_method;    int entry_type;    INT16 id_flags;    INT16 p_flags;    ptrdiff_t old_pragmas;    struct compilation *c;   #define FOO(NUMTYPE,Y,ARGTYPE,NAME) \    NUMTYPE PIKE_CONCAT(local_num_, NAME) = 0;   #include "program_areas.h"
pike.git/src/encode.c:3705:       c = THIS_COMPILATION;       /* We don't want to be affected by #pragma save_parent or    * __pragma_save_parent__.    */    old_pragmas = c->lex.pragmas;    c->lex.pragmas = (old_pragmas & ~ID_SAVE_PARENT)|ID_DONT_SAVE_PARENT;       /* Start the new program. */ -  orig_compilation_depth = compilation_depth; -  compilation_depth = -1; +     low_start_new_program(p, 1, NULL, 0, NULL);    p = Pike_compiler->new_program;   #if TWO_PASS_DECODE_WORKS    if(! data->supporter.prog)    data->supporter.prog = p;   #endif       p->flags = p_flags;       /* Kludge to get end_first_pass() to free the program. */    Pike_compiler->num_parse_error++;    -  SET_ONERROR(err, cleanup_new_program_decode, &orig_compilation_depth); +  SET_ONERROR(err, cleanup_new_program_decode, NULL);       debug_malloc_touch(p);       if (!delayed_enc_val) {    struct svalue prog;    prog.type=T_PROGRAM;    prog.u.program=p;    EDB(2,fprintf(stderr, "%*sDecoding a program to <%d>: ",    data->depth, "", entry_id.u.integer);    print_svalue(stderr, &prog);
pike.git/src/encode.c:4391:       /* 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");    }    pop_stack(); -  compilation_depth = orig_compilation_depth; +     push_program(p);       exit_compiler();       EDB(5, dump_program_tables(p, data->depth));   #ifdef PIKE_DEBUG    check_program (p);   #endif       if (bytecode_method == PIKE_BYTECODE_PORTABLE) {