Branch: Tag:

2019-10-18

2019-10-18 09:01:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Make get_name_of_function() survive destructed functions.

Fixes remainder of PIKE-221 (#8221).

3150:    if(SUBTYPEOF(n->u.sval) == FUNCTION_BUILTIN)    {    name = n->u.sval.u.efun->name; -  }else{ -  name = -  ID_FROM_INT(n->u.sval.u.object->prog, SUBTYPEOF(n->u.sval))->name; +  } else { +  struct program *p = n->u.sval.u.object->prog; +  if (!p) { +  p = id_to_program(n->u.sval.u.object->program_id);    } -  +  if (p) { +  name = ID_FROM_INT(p, SUBTYPEOF(n->u.sval))->name; +  } else { +  MAKE_CONST_STRING(name, "function in destructed object"); +  } +  }    break;       case T_ARRAY: