pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.74 2000/06/24 00:48:13 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.75 2000/07/07 01:28:57 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"   #include "pike_memory.h"
pike.git/src/docode.c:266:    if(flags & DO_LVALUE_IF_POSSIBLE)    {    flags|=DO_INDIRECT;    flags &=~DO_LVALUE_IF_POSSIBLE;    }else{    flags &=~DO_INDIRECT;    }       /* Stack check */    { -  long x_= ((char *)&x_) + STACK_DIRECTION * (32768) - stack_top ; +  long x_= ((char *)&x_) + STACK_DIRECTION * (32768) - Pike_interpreter.stack_top ;    x_*=STACK_DIRECTION;    if(x_>0)    {    yyerror("Too deep recursion in compiler. (please report this)");       emit1(F_NUMBER,0);    if(flags & DO_LVALUE)    {    emit1(F_NUMBER,0);    return 2;
pike.git/src/docode.c:872:    {    INT32 e,cases,*order;    INT32 *jumptable;    INT32 prev_switch_values_on_stack = current_switch_values_on_stack;    INT32 prev_switch_case = current_switch_case;    INT32 prev_switch_default = current_switch_default;    INT32 *prev_switch_jumptable = current_switch_jumptable;    INT32 break_save = current_break;    struct pike_string *prev_switch_type = current_switch_type;   #ifdef PIKE_DEBUG -  struct svalue *save_sp=sp; +  struct svalue *save_sp=Pike_sp;   #endif       if(do_docode(CAR(n),0)!=1)    fatal("Internal compiler error, time to panic\n");       if (!(CAR(n) && (current_switch_type = CAR(n)->type))) {    current_switch_type = mixed_type_string;    }       current_break=alloc_label();
pike.git/src/docode.c:906:    {    jumptable[e]=emit1(F_POINTER, 0);    current_switch_jumptable[e]=-1;    }       current_switch_jumptable[current_switch_case++]=-1;       DO_CODE_BLOCK(CDR(n));      #ifdef PIKE_DEBUG -  if(sp-save_sp != cases) +  if(Pike_sp-save_sp != cases)    fatal("Count cases is wrong!\n");   #endif       f_aggregate(cases); -  order=get_switch_order(sp[-1].u.array); +  order=get_switch_order(Pike_sp[-1].u.array);       if (!Pike_compiler->num_parse_error) {    /* Check for cases inside a range */    for(e=0; e<cases-1; e++)    {    if(order[e] < cases-1)    {    int o1=order[e]*2+2;    if(current_switch_jumptable[o1]==current_switch_jumptable[o1+1] &&    current_switch_jumptable[o1]==current_switch_jumptable[o1+2])
pike.git/src/docode.c:938:    }    }       if(current_switch_default < 0)    current_switch_default = ins_label(-1);       for(e=1;e<cases*2+2;e++)    if(current_switch_jumptable[e]==-1)    current_switch_jumptable[e]=current_switch_default;    -  order_array(sp[-1].u.array,order); +  order_array(Pike_sp[-1].u.array,order);       reorder((void *)(current_switch_jumptable+2),cases,sizeof(INT32)*2,order);    free((char *)order);       for(e=1; e<cases*2+2; e++)    update_arg(jumptable[e], current_switch_jumptable[e]);    -  update_arg(tmp1, store_constant(sp-1,1,0)); +  update_arg(tmp1, store_constant(Pike_sp-1,1,0));       pop_stack();    free((char *)jumptable);    free((char *)current_switch_jumptable);       current_switch_jumptable = prev_switch_jumptable;    current_switch_default = prev_switch_default;    current_switch_case = prev_switch_case;    current_switch_values_on_stack = prev_switch_values_on_stack;    current_switch_type = prev_switch_type;       emit1(F_LABEL, current_break);       current_break=break_save;   #ifdef PIKE_DEBUG -  if(recoveries && sp-evaluator_stack < recoveries->sp) +  if(Pike_interpreter.recoveries && Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer)    fatal("Stack error after F_SWITCH (underflow)\n");   #endif    return 0;    }       case F_CASE:    {    if(!current_switch_jumptable)    {    yyerror("Case outside switch.");
pike.git/src/docode.c:1003:    tmp1=eval_low(lower);    if(tmp1<1)    {    yyerror("Error in case label.");    push_int(0);    tmp1=1;    }    pop_n_elems(tmp1-1);    current_switch_values_on_stack++;    for(tmp1=current_switch_values_on_stack; tmp1 > 1; tmp1--) -  if(is_equal(sp-tmp1, sp-1)) +  if(is_equal(Pike_sp-tmp1, Pike_sp-1))    yyerror("Duplicate case.");    } else {    push_int(0);    current_switch_values_on_stack++;    }    current_switch_jumptable[current_switch_case++]=ins_label(-1);       if(CDR(n))    {    current_switch_jumptable[current_switch_case]=
pike.git/src/docode.c:1037:    tmp1=eval_low(CDR(n));    if(tmp1<1)    {    yyerror("Error in second half of case label.");    push_int(0);    tmp1=1;    }    pop_n_elems(tmp1-1);    current_switch_values_on_stack++;    for(tmp1=current_switch_values_on_stack; tmp1 > 1; tmp1--) -  if(is_equal(sp-tmp1, sp-1)) +  if(is_equal(Pike_sp-tmp1, Pike_sp-1))    yyerror("Duplicate case.");    } else {    push_int(0);    current_switch_values_on_stack++;    }    current_switch_jumptable[current_switch_case++]=-1;    }    }else{    current_switch_jumptable[current_switch_case++]=-1;    }