pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:3403:   #endif    }       /* Done. */       free_type(type);    pop_compiler_frame();    }    }    -  if(Pike_compiler->compiler_pass != COMPILER_PASS_LAST) -  p=end_first_pass(0); -  else -  p=end_first_pass(1); -  -  /* fprintf(stderr, "LANGUAGE.YACC: CLASS end\n"); */ -  -  if(p) { +     /* Update the type for the program constant, -  * since we might have a lfun::create(). */ +  * since we may have a lfun::create(). +  * +  * Do this before end_first_pass(), to keep +  * override_identifier() et al happy. +  */ +  {    struct identifier *i;    struct svalue sv; -  SET_SVAL(sv, T_PROGRAM, 0, program, p); -  i = ID_FROM_INT(Pike_compiler->new_program, $<number>4); +  SET_SVAL(sv, T_PROGRAM, 0, program, Pike_compiler->new_program); +  i = ID_FROM_INT(Pike_compiler->previous->new_program, $<number>4);    free_type(i->type);    i->type = get_type_of_svalue(&sv); -  if (p->flags & PROGRAM_CONSTANT) { +  if (Pike_compiler->new_program->flags & PROGRAM_CONSTANT) {    /* Update, in case of @constant. */    i->opt_flags = 0;    } -  +  } +  +  if(Pike_compiler->compiler_pass != COMPILER_PASS_LAST) +  p=end_first_pass(0); +  else +  p=end_first_pass(1); +  +  /* fprintf(stderr, "LANGUAGE.YACC: CLASS end\n"); */ +  +  if(p) {    free_program(p);    } else if (!Pike_compiler->num_parse_error) {    /* Make sure code in this class is aware that something went wrong. */    Pike_compiler->num_parse_error = 1;    }       $$=mkidentifiernode($<number>4);       free_node($2);    free_node($3);