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.85 2000/12/01 01:13:43 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.86 2000/12/01 08:09:45 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_error.h"   #include "pike_memory.h"   #include "svalue.h"   #include "main.h"   #include "builtin_functions.h"   #include "peep.h"   #include "docode.h"   #include "operators.h"   #include "object.h"   #include "opcodes.h"   #include "language.h"
pike.git/src/docode.c:142:    n->u.sval.u.efun->function == fun;   }      static void code_expression(node *n, INT16 flags, char *err)   {    switch(do_docode(check_node_hash(n), (INT16)(flags & ~DO_POP)))    {    case 0: my_yyerror("Void expression for %s",err);    case 1: return;    case 2: -  fatal("Internal compiler error (%s), line %ld, file %s\n", +  fatal("Internal compiler Pike_error (%s), line %ld, file %s\n",    err,    (long)lex.current_line,    lex.current_file?lex.current_file->str:"Unknown");    }   }      void do_cond_jump(node *n, int label, int iftrue, int flags)   {    iftrue=!!iftrue;    if((flags & DO_POP) && node_is_tossable(n))
pike.git/src/docode.c:616:    case F_DIVIDE:    case F_MOD:    case F_LSH:    case F_RSH:    case F_XOR:    case F_OR:    case F_AND:    case F_NOT:    case F_COMPL:    case F_NEGATE: -  fatal("Optimizer error.\n"); +  fatal("Optimizer Pike_error.\n");       case F_RANGE:    tmp1=do_docode(CAR(n),DO_NOT_COPY);    if(do_docode(CDR(n),DO_NOT_COPY)!=2) -  fatal("Compiler internal error (at %ld).\n",(long)lex.current_line); +  fatal("Compiler internal Pike_error (at %ld).\n",(long)lex.current_line);    emit0(n->token);    return DO_NOT_WARN((INT32)tmp1);       case F_INC:    case F_POST_INC:    tmp1=do_docode(CAR(n),DO_LVALUE);   #ifdef PIKE_DEBUG    if(tmp1 != 2)    fatal("HELP! FATAL INTERNAL COMPILER ERROR (1)\n");   #endif
pike.git/src/docode.c:965:    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=Pike_sp;   #endif       if(do_docode(CAR(n),0)!=1) -  fatal("Internal compiler error, time to panic\n"); +  fatal("Internal compiler Pike_error, time to panic\n");       if (!(CAR(n) && (current_switch_type = CAR(n)->type))) {    current_switch_type = mixed_type_string;    }       current_break=alloc_label();       cases=count_cases(CDR(n));       tmp1=emit1(F_SWITCH,0);
pike.git/src/docode.c:1058:    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;       low_insert_label( current_break);       current_break=break_save;   #ifdef PIKE_DEBUG    if(Pike_interpreter.recoveries && Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) -  fatal("Stack error after F_SWITCH (underflow)\n"); +  fatal("Stack Pike_error after F_SWITCH (underflow)\n");   #endif    return 0;    }       case F_CASE:    {    if(!current_switch_jumptable)    {    yyerror("Case outside switch.");    }else{
pike.git/src/docode.c:1217:    return 1;    }       case F_LVALUE_LIST:    return do_docode(CAR(n),DO_LVALUE)+do_docode(CDR(n),DO_LVALUE);       case F_ARRAY_LVALUE:    tmp1=do_docode(CAR(n),DO_LVALUE);   #ifdef PIKE_DEBUG    if(tmp1 & 1) -  fatal("Very internal compiler error.\n"); +  fatal("Very internal compiler Pike_error.\n");   #endif    emit1(F_ARRAY_LVALUE, DO_NOT_WARN((INT32)(tmp1>>1)));    return 2;       case F_ARROW:    if(CDR(n)->token != F_CONSTANT || CDR(n)->u.sval.type!=T_STRING)    fatal("Bugg in F_ARROW, index not string.");    if(flags & WANT_LVALUE)    {    /* FIXME!!!! ??? I wonder what needs fixing... /Hubbe */
pike.git/src/docode.c:1259:    if(tmp1==2)    {   #ifdef PIKE_DEBUG    if(!mklval)    fatal("Unwanted lvalue!\n");   #endif    emit0(F_INDIRECT);    }       if(do_docode(CDR(n),0) != 1) -  fatal("Internal compiler error, please report this (1)."); +  fatal("Internal compiler Pike_error, please report this (1).");    if(CDR(n)->token != F_CONSTANT &&    match_types(CDR(n)->type, string_type_string))    emit0(F_CLEAR_STRING_SUBTYPE);    return 2;    }else{    tmp1=do_docode(CAR(n), DO_NOT_COPY);       code_expression(CDR(n), DO_NOT_COPY, "index");    if(CDR(n)->token != F_CONSTANT &&    match_types(CDR(n)->type, string_type_string))
pike.git/src/docode.c:1325:    x++;    emit2(F_EXTERNAL, n->u.sval.subtype, x);    Pike_compiler->new_program->flags |= PROGRAM_USES_PARENT;    return 1;    }    }      #ifdef PIKE_DEBUG    case T_OBJECT:    if(n->u.sval.u.object->next == n->u.sval.u.object) -  fatal("Internal error: Pointer to parent cannot be a compile time constant!\n"); +  fatal("Internal Pike_error: Pointer to parent cannot be a compile time constant!\n");   #endif       default:    tmp1=store_constant(&(n->u.sval),    !(n->tree_info & OPT_EXTERNAL_DEPEND),    n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));    return 1;       case T_ARRAY:
pike.git/src/docode.c:1405:    emit1(F_GLOBAL,n->u.id.number);    }    }    return 1;       case F_VAL_LVAL:    return do_docode(CAR(n),flags) +    do_docode(CDR(n), (INT16)(flags | DO_LVALUE));       default: -  fatal("Infernal compiler error (unknown parse-tree-token).\n"); +  fatal("Infernal compiler Pike_error (unknown parse-tree-token).\n");    return 0; /* make gcc happy */    }   }      void do_code_block(node *n)   {    init_bytecode();    label_no=1;       emit1(F_BYTE,Pike_compiler->compiler_frame->max_number_of_locals);