pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:7:   #include "docode.h"   #include "main.h"   #include "error.h"   #include "lex.h"   #include "pike_memory.h"   #include "peep.h"   #include "dmalloc.h"   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: peep.c,v 1.31 2000/04/21 00:29:48 hubbe Exp $"); + RCSID("$Id: peep.c,v 1.32 2000/05/01 02:11:25 hubbe Exp $");      struct p_instr_s   {    short opcode;    short line;    struct pike_string *file;    INT32 arg;    INT32 arg2;   };   
pike.git/src/peep.c:239:    uses=(INT32 *)xalloc(sizeof(INT32) * (max_label+2));       for(e=0;e<=max_label;e++)    {    labels[e]=jumps[e]=-1;    uses[e]=0;    }       c=(p_instr *)instrbuf.s.str;    for(e=0;e<length;e++) -  if(c[e].opcode == F_LABEL) +  if(c[e].opcode == F_LABEL && c[e].arg>=0)    labels[c[e].arg]=e;       for(e=0;e<length;e++)    {    if(instrs[c[e].opcode-F_OFFSET].flags & I_POINTER)    {    while(1)    {    int tmp,tmp2;    tmp=labels[c[e].arg];
pike.git/src/peep.c:313: Inside #if defined(PIKE_DEBUG)
   dump_instr(c);    fprintf(stderr,"\n");    }   #endif       if(store_linenumbers)    store_linenumber(c->line, c->file);       switch(c->opcode)    { -  case F_NOP: break; +  case F_NOP: +  case F_START_FUNCTION: +  break;    case F_ALIGN:    while(PC % c->arg) add_to_program(0);    break;    -  +  case F_BYTE: +  add_to_program(c->arg); +  break; +     case F_DATA:    ins_int(c->arg, (void(*)(char))add_to_program);    break;       case F_LABEL: -  +  if(c->arg == -1) break;   #ifdef PIKE_DEBUG    if(c->arg > max_label || c->arg < 0)    fatal("max_label calculation failed!\n");       if(labels[c->arg] != -1)    fatal("Duplicate label!\n");   #endif    labels[c->arg]=PC;    break;   
pike.git/src/peep.c:378:    }       for(e=0;e<=max_label;e++)    {    int tmp2=labels[e];       while(jumps[e]!=-1)    {   #ifdef PIKE_DEBUG    if(labels[e]==-1) -  fatal("Hyperspace error: unknown jump point %d at %d (%d).\n",e,labels[e],jumps[e]); +  fatal("Hyperspace error: unknown jump point %d at %d (pc=%x).\n",e,labels[e],jumps[e]);   #endif    tmp=read_int(jumps[e]);    upd_int(jumps[e], tmp2 - jumps[e]);    jumps[e]=tmp;    }    }       free((char *)labels);    free((char *)jumps);    free((char *)uses);