Branch: Tag:

2014-10-06

2014-10-06 15:09:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Nettle: Reference the programs being inherited.

Make sure that there's a local symbol in the parent for the
programs that we inherit. Otherwise the parent_identifier in
the generated inherit may point back to some later override.

This happens frequently when inheriting the State class.

This fixes infinite recursion in eg Program.all_inherits()
when called with several of the Crypto and Nettle classes.

472:    struct program *parent_State_prog =    low_program_from_function(parent_obj, parent_State_fun_num);    if (parent_State_prog) { +  parent_State_fun_num = +  really_low_reference_inherited_identifier(Pike_compiler->previous, +  0, parent_State_fun_num);    low_inherit(parent_State_prog, 0, -  parent_State_fun_num + -  parent_prog->inherits[1].identifier_level, +  parent_State_fun_num,    1 + 42, 0, NULL);    }    }