Branch: Tag:

2019-06-11

2019-06-11 10:46:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Increased paranoia regarding inherit_specifiers.

The value in the variable 'state' is likely to be invalid when
the loop has failed to find the inherit, so do not propagate it.

Thanks to Stephen R. van den Berg <srb@cuci.nl> for the report.

Potential fix for [LysLysKOM 23386221].

4022:    *    * 5: 4 recursively for surrounding parent classes.    * -  * 6: this_program. +  * 6: this & this_program.    *    * Note that a deep inherit in the current class trumphs    * a not so deep inherit in a parent class (but not a
4060:    }    }    if (e < 0) { -  inherit_state = state; -  inherit_depth = depth; -  if ($1->u.sval.u.string == this_program_string || -  $1->u.sval.u.string == this_string) { +     inherit_state = Pike_compiler;    inherit_depth = 0;    e = INHERIT_SELF; -  } -  else +  +  if (($1->u.sval.u.string != this_program_string) && +  ($1->u.sval.u.string != this_string)) {    my_yyerror("No inherit or surrounding class %S.",    $1->u.sval.u.string);    } -  +  }    free_node($1);    $$ = e;    }