Branch: Tag:

2017-12-20

2017-12-20 16:50:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Improved handling of inherit in extra pass.

Don't complain about unfinished programs in the extra pass.

5053:    return;    }    -  if (Pike_compiler->compiler_pass != COMPILER_PASS_FIRST) { +  if (Pike_compiler->compiler_pass == COMPILER_PASS_EXTRA) {    struct program *old_p = -  Pike_compiler->new_program->inherits[Pike_compiler->num_inherits+1].prog; +  Pike_compiler->new_program-> +  inherits[Pike_compiler->num_inherits+1].prog;    Pike_compiler->num_inherits += old_p->num_inherits;       if (old_p != p) {    yyerror("Got different program for inherit in second pass "    "(resolver problem).");    } -  +  return; +  } +  if (Pike_compiler->compiler_pass == COMPILER_PASS_LAST) { +  struct program *old_p = +  Pike_compiler->new_program-> +  inherits[Pike_compiler->num_inherits+1].prog; +  Pike_compiler->num_inherits += old_p->num_inherits;    -  +  if (old_p != p) { +  yyerror("Got different program for inherit in second pass " +  "(resolver problem)."); +  } +     if (!(p->flags & PROGRAM_FINISHED)) {    /* Require that the inherited program really is finished in pass    * 2. Otherwise we might not have all definitions when we