Branch: Tag:

1998-01-13

1998-01-13 23:01:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Compiler update to use two pass

Rev: src/acconfig.h:1.14
Rev: src/builtin_functions.c:1.59
Rev: src/builtin_functions.h:1.5
Rev: src/compilation.h:1.4
Rev: src/configure.in:1.149
Rev: src/cpp.c:1.3
Rev: src/docode.c:1.24
Rev: src/docode.h:1.4
Rev: src/gc.c:1.24
Rev: src/interpret.c:1.57
Rev: src/interpret.h:1.16
Rev: src/language.yacc:1.51
Rev: src/las.c:1.40
Rev: src/las.h:1.9
Rev: src/lex.c:1.37
Rev: src/lex.h:1.7
Rev: src/main.c:1.32
Rev: src/modules/Image/blit.c:1.26
Rev: src/modules/Image/colortable.c:1.33
Rev: src/modules/Image/dct.c:1.11
Rev: src/modules/Image/image.c:1.73
Rev: src/modules/Image/matrix.c:1.13
Rev: src/modules/Image/operator.c:1.11
Rev: src/modules/Image/pattern.c:1.11
Rev: src/modules/Image/pnm.c:1.9
Rev: src/modules/Image/polyfill.c:1.18
Rev: src/modules/Image/togif.c:1.29
Rev: src/modules/Image/x.c:1.17
Rev: src/modules/Pipe/pipe.c:1.15
Rev: src/modules/Regexp/glue.c:1.9
Rev: src/modules/_Crypto/cbc.c:1.10
Rev: src/modules/_Crypto/crypto.c:1.24
Rev: src/modules/_Crypto/des.c:1.11
Rev: src/modules/_Crypto/pipe.c:1.11
Rev: src/modules/_Crypto/sha.c:1.9
Rev: src/modules/files/socktest.pike:1.6
Rev: src/modules/system/system.c:1.37
Rev: src/object.c:1.31
Rev: src/object.h:1.13
Rev: src/opcodes.c:1.10
Rev: src/operators.c:1.22
Rev: src/peep.c:1.16
Rev: src/peep.in:1.9
Rev: src/pike_types.c:1.27
Rev: src/pike_types.h:1.6
Rev: src/program.c:1.48
Rev: src/program.h:1.24
Rev: src/program_areas.h:1.2
Rev: src/stralloc.c:1.21
Rev: src/stralloc.h:1.10
Rev: src/svalue.c:1.18
Rev: src/testsuite.in:1.64
Rev: src/threads.c:1.51
Rev: src/threads.h:1.26

11:    */   %token F_PREFIX_256 F_PREFIX_512 F_PREFIX_768 F_PREFIX_1024   %token F_PREFIX_CHARX256 F_PREFIX_WORDX256 F_PREFIX_24BITX256 - %token F_POP_VALUE F_POP_N_ELEMS F_MARK F_MARK2 - %token F_CALL_LFUN F_CALL_LFUN_AND_POP + %token F_POP_VALUE F_POP_N_ELEMS F_MARK F_MARK2 F_LDA + %token F_CALL_LFUN F_CALL_LFUN_AND_POP F_CALL_LFUN_AND_RETURN   %token F_APPLY F_APPLY_AND_POP F_MARK_APPLY F_MARK_APPLY_POP -  + %token F_APPLY_AND_RETURN      %token F_BRANCH F_BRANCH_WHEN_ZERO F_BRANCH_WHEN_NON_ZERO   %token F_BRANCH_WHEN_LT F_BRANCH_WHEN_GT
31:   /*    * Basic value pushing    */ - %token F_LFUN F_GLOBAL F_LOCAL F_2_LOCALS F_MARK_AND_LOCAL - %token F_GLOBAL_LVALUE F_LOCAL_LVALUE + %token F_LFUN + %token F_GLOBAL F_GLOBAL_LVALUE + %token F_LOCAL F_2_LOCALS F_LOCAL_LVALUE F_MARK_AND_LOCAL + %token F_EXTERNAL F_EXTERNAL_LVALUE   %token F_CLEAR_LOCAL F_CLEAR_2_LOCAL F_CLEAR_STRING_SUBTYPE   %token F_CONSTANT F_FLOAT F_STRING F_ARROW_STRING   %token F_NUMBER F_NEG_NUMBER F_CONST_1 F_CONST0 F_CONST1 F_BIGNUM
49:   %token F_ASSIGN_LOCAL F_ASSIGN_LOCAL_AND_POP   %token F_ASSIGN_GLOBAL F_ASSIGN_GLOBAL_AND_POP   %token F_ADD F_SUBTRACT F_ADD_INT F_ADD_NEG_INT + %token F_ADD_TO_AND_POP   %token F_MULTIPLY F_DIVIDE F_MOD      %token F_LT F_GT F_EQ F_GE F_LE F_NE
63:   %token F_FOREACH      %token F_SIZEOF F_SIZEOF_LOCAL - %token F_ADD_TO_AND_POP + %token F_CALL_FUNCTION F_CALL_FUNCTION_AND_RETURN      /*    * These are token values that needn't have an associated code for the
130:   %token F_WHILE   %token F_XOR_EQ   %token F_NOP + %token F_UNDEFINED      %token F_ALIGN   %token F_POINTER
157:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.50 1997/10/27 09:59:21 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.51 1998/01/13 22:56:43 hubbe Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
177:   #include "docode.h"   #include "machine.h"    - #define YYMAXDEPTH 600 + #define YYMAXDEPTH 1000      #ifdef DEBUG   #define YYDEBUG 1   #endif    - void free_all_local_names(void); +    void add_local_name(struct pike_string *,struct pike_string *);    - /* -  * The names and types of arguments and auto variables. -  */ - struct locals *local_variables = 0; -  +    static int varargs;   static INT32 current_modifiers;   static struct pike_string *last_identifier=0;
206:    }   }    +    /*    * Kludge for Bison not using prototypes.    */
332:   %type <n> m_expr_list   %type <n> m_expr_list2   %type <n> new_local_name - %type <n> optional_comma_expr +    %type <n> optional_else_part   %type <n> return   %type <n> sscanf
344:   %type <n> unused   %type <n> unused2   %type <n> while + %type <n> optional_comma_expr   %%      all: program;
359:   string_constant: low_string    | string_constant '+' low_string    { -  $$=add_shared_strings($1,$3); -  free_string($1); -  free_string($3); +  $$=add_and_free_shared_strings($1,$3);    }    ;   
371:      program_ref: string_constant    { -  reference_shared_string($1); +  ref_push_string($1);    push_string($1); -  push_string($1); -  reference_shared_string(current_file); -  push_string(current_file); +  ref_push_string(lex.current_file);    SAFE_APPLY_MASTER("handle_inherit", 2);       if(sp[-1].type != T_PROGRAM)
388:    push_string(last_identifier);    last_identifier->refs++;    }else{ -  push_text(""); +  push_constant_text("");    }       resolv_constant($1); -  if(sp[-1].type == T_OBJECT) +  switch(sp[-1].type)    { -  struct program *p=sp[-1].u.object->prog; -  if(!p) +  case T_OBJECT: +  if(!sp[-1].u.object->prog)    {    pop_stack();    push_int(0);    }else{ -  +  struct program *p=sp[-1].u.object->prog;    p->refs++;    pop_stack();    push_program(p);    } -  } -  if(sp[-1].type != T_PROGRAM) -  { +  break; +  +  case T_FUNCTION: +  if(program_from_function(sp-1)) +  break; +  +  default:    yyerror("Illegal program identifier");    pop_stack();    push_int(0); -  +  +  case T_PROGRAM: +  break;    } -  +     free_node($1);    }    ;      inheritance: modifiers F_INHERIT program_ref optional_rename_inherit ';'    { -  struct pike_string *s; -  if(sp[-1].type == T_PROGRAM) +  if(!(new_program->flags & PROGRAM_PASS_1_DONE))    { -  s=sp[-2].u.string; +  struct pike_string *s=sp[-2].u.string;    if($4) s=$4; -  do_inherit(sp[-1].u.program,$1,s); -  if($4) free_string($4); +  do_inherit(sp-1,$1,s);    } -  +  if($4) free_string($4);    pop_n_elems(2);    }    ;
441:   constant_name: F_IDENTIFIER '=' expr0    {    int tmp; -  node *n; +     /* This can be made more lenient in the future */ -  n=mknode(F_ARG_LIST,$3,0); /* Make sure it is optimized */ -  if(!is_const(n)) +  +  /* Ugly hack to make sure that $3 is optimized */ +  tmp=compiler_pass; +  $3=mknode(F_ARG_LIST,$3,0); +  compiler_pass=tmp; +  +  if(!is_const($3))    { -  struct svalue tmp; +  if(compiler_pass==2)    yyerror("Constant definition is not constant."); -  tmp.type=T_INT; -  tmp.u.integer=0; -  add_constant($1,&tmp, current_modifiers); +  add_constant($1,0, current_modifiers); /* Prototype */    } else { -  tmp=eval_low(n); -  free_node(n); +  tmp=eval_low($3);    if(tmp < 1)    {    yyerror("Error in constant definition.");
462:    add_constant($1,sp-1,current_modifiers);    pop_stack();    } +  } +  if($3) free_node($3);    free_string($1);    } -  } +     ;      constant_list: constant_name
484:      type_or_error: simple_type    { -  if(local_variables->current_type) -  free_string(local_variables->current_type); -  local_variables->current_type=$1; +  if(compiler_frame->current_type) +  free_string(compiler_frame->current_type); +  compiler_frame->current_type=$1;    }    | /* empty */    {    yyerror("Missing type."); -  copy_shared_string(local_variables->current_type, +  copy_shared_string(compiler_frame->current_type,    mixed_type_string);    }       - def: modifiers type_or_error optional_stars F_IDENTIFIER '(' arguments ')' + def: modifiers type_or_error optional_stars F_IDENTIFIER    { -  +  push_compiler_frame(); +  if(!compiler_frame->previous || +  !compiler_frame->previous->current_type) +  { +  yyerror("Internal compiler fault"); +  copy_shared_string(compiler_frame->current_type, +  mixed_type_string); +  }else{ +  copy_shared_string(compiler_frame->current_type, +  compiler_frame->previous->current_type); +  } +  } +  '(' arguments ')' +  {    int e;    /* construct the function type */ -  push_finished_type(local_variables->current_type); +  push_finished_type(compiler_frame->current_type);    while(--$3>=0) push_type(T_ARRAY);    -  if(local_variables->current_return_type) -  free_string(local_variables->current_return_type); -  local_variables->current_return_type=pop_type(); +  if(compiler_frame->current_return_type) +  free_string(compiler_frame->current_return_type); +  compiler_frame->current_return_type=pop_type();    -  push_finished_type(local_variables->current_return_type); +  push_finished_type(compiler_frame->current_return_type);    -  e=$6-1; +  e=$7-1;    if(varargs)    { -  push_finished_type(local_variables->variable[e].type); +  push_finished_type(compiler_frame->variable[e].type);    e--;    varargs=0;    pop_type_stack();
522:    push_type(T_MANY);    for(; e>=0; e--)    { -  push_finished_type(local_variables->variable[e].type); +  push_finished_type(compiler_frame->variable[e].type);    if($1 & ID_VARARGS)    {    push_type(T_VOID);
532:    push_type(T_FUNCTION);       $<string>$=pop_type(); +  +  if(compiler_pass==1) +  {    define_function($4,    $<string>$,    $1,    IDENTIFIER_PIKE_FUNCTION,    0);    } -  +  }    block_or_semi    {    int e; -  if($9) +  if($10)    { -  for(e=0; e<$6; e++) +  for(e=0; e<$7; e++)    { -  if(!local_variables->variable[e].name || -  !local_variables->variable[e].name->len) +  if(!compiler_frame->variable[e].name || +  !compiler_frame->variable[e].name->len)    {    my_yyerror("Missing name for argument %d",e);    }    }    -  dooptcode($4, $9, $<string>8, $1); +  dooptcode($4, $10, $<string>9, $1);   #ifdef DEBUG    if(recoveries && sp-evaluator_stack < recoveries->sp)    fatal("Stack error (underflow)\n");   #endif    } -  if(local_variables->current_return_type) -  { -  free_string(local_variables->current_return_type); -  local_variables->current_return_type=0; -  } -  free_all_local_names(); +  pop_compiler_frame();    free_string($4); -  free_string($<string>8); +  free_string($<string>9);    }    | modifiers type_or_error name_list ';' {}    | inheritance {}
575:    | error ';' { yyerrok; }    {    reset_type_stack(); - /* if(num_parse_error>5) YYACCEPT; */ + /* if(num_parse_error>5) YYACCEPT; */    }    ;    -  +    optional_dot_dot_dot: F_DOT_DOT_DOT { $$=1; }    | /* empty */ { $$=0; }    ;
588:    | /* empty */ { $$=0; }    ;    -  +    new_arg_name: type optional_dot_dot_dot optional_identifier    {    if(varargs) yyerror("Can't define more arguments after ...");
598:    push_type(T_ARRAY);    varargs=1;    } -  if(!$3) $3=make_shared_string(""); +  if(!$3) +  MAKE_CONSTANT_SHARED_STRING($3,""); +     if(islocal($3) >= 0)    my_yyerror("Variable '%s' appears twice in argument list.",    $3->str);
669:   opt_object_type: /* Empty */ { push_type_int(0); }    | '(' program_ref ')'    { -  if(sp[-1].type == T_PROGRAM) +  struct program *p=program_from_svalue(sp-1); +  if(p)    { -  push_type_int(sp[-1].u.program->id); +  push_type_int(p->id);    }else{    yyerror("Not a valid program specifier");    push_type_int(0);
760:   new_name: optional_stars F_IDENTIFIER    {    struct pike_string *type; -  push_finished_type(local_variables->current_type); +  push_finished_type(compiler_frame->current_type);    while($1--) push_type(T_ARRAY);    type=pop_type();    define_variable($2, type, current_modifiers);
770:    | optional_stars F_IDENTIFIER '='    {    struct pike_string *type; -  push_finished_type(local_variables->current_type); +  push_finished_type(compiler_frame->current_type);    while($1--) push_type(T_ARRAY);    type=pop_type();    $<number>$=define_variable($2, type, current_modifiers);
789:      new_local_name: optional_stars F_IDENTIFIER    { -  push_finished_type(local_variables->current_type); +  push_finished_type(compiler_frame->current_type);    while($1--) push_type(T_ARRAY);    add_local_name($2, pop_type());    $$=mknode(F_ASSIGN,mkintnode(0), mklocalnode(islocal($2)));    }    | optional_stars F_IDENTIFIER '=' expr0    { -  push_finished_type(local_variables->current_type); +  push_finished_type(compiler_frame->current_type);    while($1--) push_type(T_ARRAY);    add_local_name($2, pop_type());    $$=mknode(F_ASSIGN,$4,mklocalnode(islocal($2)));
806:      block:'{'    { -  $<number>$=local_variables->current_number_of_locals; +  $<number>$=compiler_frame->current_number_of_locals;    }    statements '}'    { -  while(local_variables->current_number_of_locals > $<number>2) -  { -  int e; -  e=--(local_variables->current_number_of_locals); -  free_string(local_variables->variable[e].name); -  free_string(local_variables->variable[e].type); -  } +  pop_local_variables($<number>2);    $$=$3;    }    ;
861:      lambda: F_LAMBDA    { -  push_locals(); +  push_compiler_frame();    $<number>$=comp_stackp;    -  if(local_variables->current_return_type) -  free_string(local_variables->current_return_type); -  copy_shared_string(local_variables->current_return_type,any_type_string); +  if(compiler_frame->current_return_type) +  free_string(compiler_frame->current_return_type); +  copy_shared_string(compiler_frame->current_return_type,any_type_string);    }    func_args failsafe_block    {
875:    int f,e;    struct pike_string *name;    -  setup_fake_program(); +     fix_comp_stack($<number>2);       push_type(T_MIXED);
883:    e=$3-1;    if(varargs)    { -  push_finished_type(local_variables->variable[e].type); +  push_finished_type(compiler_frame->variable[e].type);    e--;    varargs=0;    pop_type_stack();
892:    }    push_type(T_MANY);    for(; e>=0; e--) -  push_finished_type(local_variables->variable[e].type); +  push_finished_type(compiler_frame->variable[e].type);       push_type(T_FUNCTION);       type=pop_type();    -  +  if(new_program->flags | PROGRAM_PASS_1_DONE) +  {    sprintf(buf,"__lambda_%ld", -  (long)fake_program.num_identifier_references); +  (long)new_program->num_identifier_references);    name=make_shared_string(buf);       f=dooptcode(name,    mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0)),    type,    0); - #ifdef DEBUG -  if(recoveries && sp-evaluator_stack < recoveries->sp) -  fatal("Stack error (underflow)\n"); - #endif +  }    free_string(name);    free_string(type);    comp_stackp=$<number>2; -  pop_locals(); +  pop_compiler_frame();    $$=mkidentifiernode(f);    }    ;
922:    | error { yyerrok; }    ;    - class: modifiers F_CLASS optional_identifier + class: modifiers F_CLASS F_IDENTIFIER    { -  start_new_program(); -  /* write(2, "start\n", 6); */ -  } -  failsafe_program +  if(compiler_pass==1)    { -  struct svalue s; -  /* write(2, "end\n", 4); */ -  s.u.program=end_program(); -  if(!s.u.program) +  low_start_new_program(0, $3, $1); +  }else{ +  int i; +  struct program *p; +  struct identifier *id; +  i=isidentifier($3); +  if(i<0)    { -  yyerror("Class definition failed."); -  s.type=T_INT; -  s.subtype=0; -  } else { -  s.type=T_PROGRAM; -  s.subtype=0; +  low_start_new_program(new_program,0,0); +  yyerror("Pass 2: program not defined!"); +  }else{ +  id=ID_FROM_INT(new_program, i); +  if(IDENTIFIER_IS_CONSTANT(id->identifier_flags)) +  { +  struct svalue *s; +  s=PROG_FROM_INT(new_program,i)->constants+id->func.offset; +  if(s->type==T_PROGRAM) +  { +  low_start_new_program(s->u.program, $3, $1); +  }else{ +  yyerror("Pass 2: constant redefined!"); +  low_start_new_program(new_program, 0,0);    } -  if($3) +  }else{ +  yyerror("Pass 2: class constant no longer constant!"); +  low_start_new_program(new_program, 0,0); +  } +  } +  } +  } +  failsafe_program    { -  add_constant($3, &s, $1); +  struct program *p; +  if(compiler_pass == 1) +  p=end_first_pass(0); +  else +  p=end_program(); +  +  $$=mkidentifiernode(isidentifier($3)); +  +  if(!p) +  yyerror("Class definition failed."); +  else +  free_program(p); +     free_string($3);    } -  $$=mksvaluenode(&s); -  free_svalue(&s); -  } +     ;    - cond: F_IF '(' comma_expr ')' statement optional_else_part + cond: F_IF    { -  $$=mknode('?',$3,mknode(':',$5,$6)); +  $<number>$=compiler_frame->current_number_of_locals; +  } +  '(' comma_expr ')' statement optional_else_part +  { +  $$=mknode('?',$4,mknode(':',$6,$7));    $$->line_number=$1;    $$=mkcastnode(void_type_string,$$);    $$->line_number=$1; -  +  pop_local_variables($<number>2);    }    ;   
964:    | F_ELSE statement { $$=$2; }    ;    - foreach: F_FOREACH '(' expr0 ',' lvalue ')' statement + foreach: F_FOREACH    { -  $$=mknode(F_FOREACH,mknode(F_VAL_LVAL,$3,$5),$7); +  $<number>$=compiler_frame->current_number_of_locals; +  } +  '(' expr0 ',' lvalue ')' statement +  { +  $$=mknode(F_FOREACH, mknode(F_VAL_LVAL,$4,$6),$8);    $$->line_number=$1; -  +  pop_local_variables($<number>2);    }    ;   
978:    }    ;    - for: F_FOR '(' unused ';' for_expr ';' unused ')' statement + for: F_FOR    { -  int i=current_line; -  current_line=$1; -  $$=mknode(F_ARG_LIST,mkcastnode(void_type_string,$3),mknode(F_FOR,$5,mknode(':',$9,$7))); -  current_line=i; +  $<number>$=compiler_frame->current_number_of_locals;    } -  +  '(' unused ';' for_expr ';' unused ')' statement +  { +  int i=lex.current_line; +  lex.current_line=$1; +  $$=mknode(F_ARG_LIST,mkcastnode(void_type_string,$4),mknode(F_FOR,$6,mknode(':',$10,$8))); +  lex.current_line=i; +  pop_local_variables($<number>2); +  }    ;       - while: F_WHILE '(' comma_expr ')' statement + while: F_WHILE    { -  int i=current_line; -  current_line=$1; -  $$=mknode(F_FOR,$3,mknode(':',$5,NULL)); -  current_line=i; +  $<number>$=compiler_frame->current_number_of_locals;    } -  +  '(' comma_expr ')' statement +  { +  int i=lex.current_line; +  lex.current_line=$1; +  $$=mknode(F_FOR,$4,mknode(':',$6,NULL)); +  lex.current_line=i; +  pop_local_variables($<number>2); +  }    ;      for_expr: /* EMPTY */ { $$=mkintnode(1); }    | comma_expr    ;    - switch: F_SWITCH '(' comma_expr ')' statement + switch: F_SWITCH    { -  $$=mknode(F_SWITCH,$3,$5); +  $<number>$=compiler_frame->current_number_of_locals; +  } +  '(' comma_expr ')' statement +  { +  $$=mknode(F_SWITCH,$4,$6);    $$->line_number=$1; -  +  pop_local_variables($<number>2);    }    ;   
1020:      return: F_RETURN    { -  if(!match_types(local_variables->current_return_type, +  if(!match_types(compiler_frame->current_return_type,    void_type_string))    {    yyerror("Must return a value for a non-void function.");
1046:   comma_expr: comma_expr2    | type2    { -  if(local_variables->current_type) -  free_string(local_variables->current_type); -  local_variables->current_type=pop_type(); +  if(compiler_frame->current_type) +  free_string(compiler_frame->current_type); +  compiler_frame->current_type=pop_type();    } local_name_list { $$=$3; }    ;   
1197:    $$=mklocalnode(i);    }else if((i=isidentifier($1))>=0){    $$=mkidentifiernode(i); -  }else if(find_module_identifier($1)){ -  $$=mkconstantsvaluenode(sp-1); -  pop_stack(); -  }else{ +  }else if(!($$=find_module_identifier($1))){    $$=0;    if(!num_parse_error)    { -  if( get_master() ) +  if(get_master())    {    reference_shared_string($1);    push_string($1); -  reference_shared_string(current_file); -  push_string(current_file); +  ref_push_string(lex.current_file);    SAFE_APPLY_MASTER("resolv", 2);       if(throw_value.type == T_STRING)
1224:    }    pop_stack();    }else{ +  if(compiler_pass==2) +  {    my_yyerror("'%s' undefined.", $1->str); -  +  }else{ +  $$=mknode(F_UNDEFINED,0,0);    }    }    } -  +  }    free_string($1);    }    | F_PREDEF F_COLON_COLON F_IDENTIFIER
1249:    int f;    struct reference *idp;    -  setup_fake_program(); +     f=reference_inherited_identifier($1,$3); -  idp=fake_program.identifier_references+f; -  if (f<0 || ID_FROM_PTR(&fake_program,idp)->func.offset == -1) +  idp=new_program->identifier_references+f; +  if (f<0)    {    my_yyerror("Undefined identifier %s::%s", $1->str,$3->str);    $$=mkintnode(0);
1268:    int e,i;       $$=0; -  setup_fake_program(); -  for(e=1;e<(int)fake_program.num_inherits;e++) +  for(e=1;e<(int)new_program->num_inherits;e++)    { -  if(fake_program.inherits[e].inherit_level!=1) continue; +  if(new_program->inherits[e].inherit_level!=1) continue;    i=low_reference_inherited_identifier(e,$2);    if(i==-1) continue;    if($$)
1358:   low_string: F_STRING    | low_string F_STRING    { -  $$=add_shared_strings($1,$2); -  free_string($1); -  free_string($2); +  $$=add_and_free_shared_strings($1,$2);    }    ;   
1386:    if ( get_master() )    {    sp->type = T_STRING; -  copy_shared_string(sp->u.string, current_file); +  copy_shared_string(sp->u.string, lex.current_file);    sp++;    sp->type = T_INT; -  sp->u.integer = current_line; +  sp->u.integer = lex.current_line;    sp++;    sp->type = T_STRING;    sp->u.string = make_shared_string(str);    sp++;    SAFE_APPLY_MASTER("compile_error",3);    pop_stack(); - #ifdef DEBUG -  if(recoveries && sp-evaluator_stack < recoveries->sp) -  fatal("Stack error (underflow)\n"); - #endif +     }else{    (void)fprintf(stderr, "%s:%ld: %s\n", -  current_file->str, -  (long)current_line, +  lex.current_file->str, +  (long)lex.current_line,    str);    fflush(stderr);    }
1413:   void add_local_name(struct pike_string *str,    struct pike_string *type)   { -  if (local_variables->current_number_of_locals == MAX_LOCAL) +  if (compiler_frame->current_number_of_locals == MAX_LOCAL)    {    yyerror("Too many local variables");    }else { -  local_variables->variable[local_variables->current_number_of_locals].type = type; -  local_variables->variable[local_variables->current_number_of_locals].name = str; -  local_variables->current_number_of_locals++; -  if(local_variables->current_number_of_locals > -  local_variables->max_number_of_locals) +  compiler_frame->variable[compiler_frame->current_number_of_locals].type = type; +  compiler_frame->variable[compiler_frame->current_number_of_locals].name = str; +  compiler_frame->current_number_of_locals++; +  if(compiler_frame->current_number_of_locals > +  compiler_frame->max_number_of_locals)    { -  local_variables->max_number_of_locals= -  local_variables->current_number_of_locals; +  compiler_frame->max_number_of_locals= +  compiler_frame->current_number_of_locals;    }    }   }
1433:   int islocal(struct pike_string *str)   {    int e; -  for(e=local_variables->current_number_of_locals-1;e>=0;e--) -  if(local_variables->variable[e].name==str) +  for(e=compiler_frame->current_number_of_locals-1;e>=0;e--) +  if(compiler_frame->variable[e].name==str)    return e;    return -1;   } -  - void free_all_local_names(void) - { -  int e; -  -  for (e=0; e<local_variables->current_number_of_locals; e++) -  { -  if(local_variables->variable[e].name) -  { -  free_string(local_variables->variable[e].name); -  free_string(local_variables->variable[e].type); -  } -  local_variables->variable[e].name=0; -  local_variables->variable[e].type=0; -  } -  local_variables->current_number_of_locals = 0; -  local_variables->max_number_of_locals = 0; - } -  +