Branch: Tag:

2019-04-07

2019-04-07 18:14:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Pike.InhibitDestruct: Mark identifiers as local.

This is to avoid surprises if the user overloads the identifiers.

2526:    *! @[destruct()], @[lfun::_destruct()]    */    PIKEFUN void inhibit_destruct() -  flags ID_PROTECTED; +  flags ID_PROTECTED|ID_LOCAL;    {    if (UNLIKELY(THIS->lock_count < 0)) {    THIS->lock_count--;
2544:    *! @[destruct()], @[lfun::_destruct()]    */    PIKEFUN void permit_destruct() -  flags ID_PROTECTED; +  flags ID_PROTECTED|ID_LOCAL;    {    if (!THIS->lock_count) {    Pike_error("permit_destruct() without inhibit.\n");
2573:    *! @[destruct()], @[lfun::_destruct()]    */    PIKEFUN int(0..1) _destruct(int|void reason) -  flags ID_PROTECTED; +  flags ID_PROTECTED|ID_LOCAL;    {    if (THIS->lock_count > 0) {    THIS->lock_count = -THIS->lock_count;