Branch: Tag:

2021-07-19

2021-07-19 13:03:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fix generation of nested __INIT() calls.

Fixes bug triggered by Calendar.Time when generating __INIT()
call to Calendar.TimeRanges::__INIT().

5062:    init_name = lfun_strings[LFUN___INIT];       /* Collect references to inherited __INIT functions */ -  if (!(Pike_compiler->new_program->flags & PROGRAM_AVOID_CHECK)) { +     for(e=Pike_compiler->new_program->num_inherits-1;e;e--)    {    int id;    if(Pike_compiler->new_program->inherits[e].inherit_level!=1) continue; -  id = QUICK_FIND_LFUN(Pike_compiler->new_program->inherits[e].prog, +  id = FIND_LFUN(Pike_compiler->new_program->inherits[e].prog,    LFUN___INIT); -  id = really_low_reference_inherited_identifier(0, e, id); +     if(id!=-1)    { -  Pike_compiler->init_node=mknode(F_COMMA_EXPR, +  id = really_low_reference_inherited_identifier(0, e, id); +  Pike_compiler->init_node = +  mknode(F_COMMA_EXPR,    mkcastnode(void_type_string,    mkapplynode(mkidentifiernode(id),0)),    Pike_compiler->init_node);    }    } -  } +        if (finish == 1) {    if (Pike_compiler->compiler_pass == COMPILER_PASS_FIRST) {